@typescript-eslint/utils 6.0.0 → 7.0.0-alpha.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 +5 -5
- package/_ts4.3/dist/ast-utils/eslint-utils/PatternMatcher.d.ts +0 -48
- package/_ts4.3/dist/ast-utils/eslint-utils/ReferenceTracker.d.ts +0 -76
- package/_ts4.3/dist/ast-utils/eslint-utils/astUtilities.d.ts +0 -76
- package/_ts4.3/dist/ast-utils/eslint-utils/index.d.ts +0 -6
- package/_ts4.3/dist/ast-utils/eslint-utils/predicates.d.ts +0 -32
- package/_ts4.3/dist/ast-utils/eslint-utils/scopeAnalysis.d.ts +0 -18
- package/_ts4.3/dist/ast-utils/helpers.d.ts +0 -1207
- package/_ts4.3/dist/ast-utils/index.d.ts +0 -5
- package/_ts4.3/dist/ast-utils/misc.d.ts +0 -8
- package/_ts4.3/dist/ast-utils/predicates.d.ts +0 -70
- package/_ts4.3/dist/eslint-utils/InferTypesFromRule.d.ts +0 -11
- package/_ts4.3/dist/eslint-utils/RuleCreator.d.ts +0 -35
- package/_ts4.3/dist/eslint-utils/applyDefault.d.ts +0 -10
- package/_ts4.3/dist/eslint-utils/deepMerge.d.ts +0 -17
- package/_ts4.3/dist/eslint-utils/getParserServices.d.ts +0 -24
- package/_ts4.3/dist/eslint-utils/index.d.ts +0 -7
- package/_ts4.3/dist/eslint-utils/nullThrows.d.ts +0 -14
- package/_ts4.3/dist/index.d.ts +0 -7
- package/_ts4.3/dist/json-schema.d.ts +0 -392
- package/_ts4.3/dist/ts-eslint/AST.d.ts +0 -9
- package/_ts4.3/dist/ts-eslint/CLIEngine.d.ts +0 -137
- package/_ts4.3/dist/ts-eslint/ESLint.d.ts +0 -376
- package/_ts4.3/dist/ts-eslint/Linter.d.ts +0 -331
- package/_ts4.3/dist/ts-eslint/ParserOptions.d.ts +0 -2
- package/_ts4.3/dist/ts-eslint/Rule.d.ts +0 -400
- package/_ts4.3/dist/ts-eslint/RuleTester.d.ts +0 -161
- package/_ts4.3/dist/ts-eslint/Scope.d.ts +0 -44
- package/_ts4.3/dist/ts-eslint/SourceCode.d.ts +0 -346
- package/_ts4.3/dist/ts-eslint/index.d.ts +0 -10
- package/_ts4.3/dist/ts-estree.d.ts +0 -3
|
@@ -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,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
|
package/_ts4.3/dist/index.d.ts
DELETED
|
@@ -1,7 +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
|
-
export { ASTUtils, ESLintUtils, JSONSchema, TSESLint };
|
|
6
|
-
export * from './ts-estree';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,392 +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
|
-
/**
|
|
16
|
-
* Meta schema
|
|
17
|
-
*
|
|
18
|
-
* Recommended values:
|
|
19
|
-
* - 'http://json-schema.org/schema#'
|
|
20
|
-
* - 'http://json-schema.org/hyper-schema#'
|
|
21
|
-
* - 'http://json-schema.org/draft-04/schema#'
|
|
22
|
-
* - 'http://json-schema.org/draft-04/hyper-schema#'
|
|
23
|
-
* - 'http://json-schema.org/draft-03/schema#'
|
|
24
|
-
* - 'http://json-schema.org/draft-03/hyper-schema#'
|
|
25
|
-
*
|
|
26
|
-
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
27
|
-
*/
|
|
28
|
-
export type JSONSchema4Version = string;
|
|
29
|
-
/**
|
|
30
|
-
* JSON Schema V4
|
|
31
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
|
|
32
|
-
*/
|
|
33
|
-
export type JSONSchema4 = JSONSchema4AllOfSchema | JSONSchema4AnyOfSchema | JSONSchema4AnySchema | JSONSchema4ArraySchema | JSONSchema4BoleanSchema | JSONSchema4MultiSchema | JSONSchema4NullSchema | JSONSchema4NumberSchema | JSONSchema4ObjectSchema | JSONSchema4OneOfSchema | JSONSchema4RefSchema | JSONSchema4StringSchema;
|
|
34
|
-
interface JSONSchema4Base {
|
|
35
|
-
id?: string | undefined;
|
|
36
|
-
$schema?: JSONSchema4Version | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* A single type, or a union of simple types
|
|
39
|
-
*/
|
|
40
|
-
type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
|
|
41
|
-
/**
|
|
42
|
-
* Path to a schema defined in `definitions`/`$defs` that will form the base
|
|
43
|
-
* for this schema.
|
|
44
|
-
*
|
|
45
|
-
* If you are defining an "array" schema (`schema: [ ... ]`) for your rule
|
|
46
|
-
* then you should prefix this with `items/0` so that the validator can find
|
|
47
|
-
* your definitions.
|
|
48
|
-
*
|
|
49
|
-
* eg: `'#/items/0/definitions/myDef'`
|
|
50
|
-
*
|
|
51
|
-
* Otherwise if you are defining an "object" schema (`schema: { ... }`) for
|
|
52
|
-
* your rule you can directly reference your definitions
|
|
53
|
-
*
|
|
54
|
-
* eg: `'#/definitions/myDef'`
|
|
55
|
-
*/
|
|
56
|
-
$ref?: string | undefined;
|
|
57
|
-
/**
|
|
58
|
-
* This attribute is a string that provides a short description of the
|
|
59
|
-
* instance property.
|
|
60
|
-
*
|
|
61
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
|
|
62
|
-
*/
|
|
63
|
-
title?: string | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* This attribute is a string that provides a full description of the of
|
|
66
|
-
* purpose the instance property.
|
|
67
|
-
*
|
|
68
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
|
|
69
|
-
*/
|
|
70
|
-
description?: string | undefined;
|
|
71
|
-
/**
|
|
72
|
-
* Reusable definitions that can be referenced via `$ref`
|
|
73
|
-
*/
|
|
74
|
-
definitions?: {
|
|
75
|
-
[k: string]: JSONSchema4;
|
|
76
|
-
} | undefined;
|
|
77
|
-
/**
|
|
78
|
-
* Reusable definitions that can be referenced via `$ref`
|
|
79
|
-
*/
|
|
80
|
-
$defs?: {
|
|
81
|
-
[k: string]: JSONSchema4;
|
|
82
|
-
} | undefined;
|
|
83
|
-
/**
|
|
84
|
-
* The value of this property MUST be another schema which will provide
|
|
85
|
-
* a base schema which the current schema will inherit from. The
|
|
86
|
-
* inheritance rules are such that any instance that is valid according
|
|
87
|
-
* to the current schema MUST be valid according to the referenced
|
|
88
|
-
* schema. This MAY also be an array, in which case, the instance MUST
|
|
89
|
-
* be valid for all the schemas in the array. A schema that extends
|
|
90
|
-
* another schema MAY define additional attributes, constrain existing
|
|
91
|
-
* attributes, or add other constraints.
|
|
92
|
-
*
|
|
93
|
-
* Conceptually, the behavior of extends can be seen as validating an
|
|
94
|
-
* instance against all constraints in the extending schema as well as
|
|
95
|
-
* the extended schema(s).
|
|
96
|
-
*
|
|
97
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
|
|
98
|
-
*/
|
|
99
|
-
extends?: string[] | string | undefined;
|
|
100
|
-
/**
|
|
101
|
-
* The default value for the item if not present
|
|
102
|
-
*/
|
|
103
|
-
default?: JSONSchema4Type | undefined;
|
|
104
|
-
/**
|
|
105
|
-
* This attribute indicates if the instance must have a value, and not
|
|
106
|
-
* be undefined. This is false by default, making the instance
|
|
107
|
-
* optional.
|
|
108
|
-
*
|
|
109
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
|
|
110
|
-
*/
|
|
111
|
-
required?: string[] | boolean | undefined;
|
|
112
|
-
/**
|
|
113
|
-
* (NOT) Must not be valid against the given schema
|
|
114
|
-
*/
|
|
115
|
-
not?: JSONSchema4 | undefined;
|
|
116
|
-
/**
|
|
117
|
-
* (AND) Must be valid against all of the sub-schemas
|
|
118
|
-
*/
|
|
119
|
-
allOf?: JSONSchema4[] | undefined;
|
|
120
|
-
/**
|
|
121
|
-
* (OR) Must be valid against any of the sub-schemas
|
|
122
|
-
*/
|
|
123
|
-
anyOf?: JSONSchema4[] | undefined;
|
|
124
|
-
/**
|
|
125
|
-
* (XOR) Must be valid against exactly one of the sub-schemas
|
|
126
|
-
*/
|
|
127
|
-
oneOf?: JSONSchema4[] | undefined;
|
|
128
|
-
}
|
|
129
|
-
export interface JSONSchema4RefSchema extends JSONSchema4Base {
|
|
130
|
-
type?: undefined;
|
|
131
|
-
$ref: string;
|
|
132
|
-
}
|
|
133
|
-
export interface JSONSchema4AllOfSchema extends JSONSchema4Base {
|
|
134
|
-
type?: undefined;
|
|
135
|
-
allOf: JSONSchema4[];
|
|
136
|
-
}
|
|
137
|
-
export interface JSONSchema4AnyOfSchema extends JSONSchema4Base {
|
|
138
|
-
type?: undefined;
|
|
139
|
-
anyOf: JSONSchema4[];
|
|
140
|
-
}
|
|
141
|
-
export interface JSONSchema4OneOfSchema extends JSONSchema4Base {
|
|
142
|
-
type?: undefined;
|
|
143
|
-
oneOf: JSONSchema4[];
|
|
144
|
-
}
|
|
145
|
-
export interface JSONSchema4MultiSchema extends Omit<JSONSchema4ObjectSchema, 'enum' | 'type'>, Omit<JSONSchema4ArraySchema, 'enum' | 'type'>, Omit<JSONSchema4StringSchema, 'enum' | 'type'>, Omit<JSONSchema4NumberSchema, 'enum' | 'type'>, Omit<JSONSchema4BoleanSchema, 'enum' | 'type'>, Omit<JSONSchema4NullSchema, 'enum' | 'type'>, Omit<JSONSchema4AnySchema, 'enum' | 'type'> {
|
|
146
|
-
type: JSONSchema4TypeName[];
|
|
147
|
-
/**
|
|
148
|
-
* This provides an enumeration of all possible values that are valid
|
|
149
|
-
* for the instance property. This MUST be an array, and each item in
|
|
150
|
-
* the array represents a possible value for the instance value. If
|
|
151
|
-
* this attribute is defined, the instance value MUST be one of the
|
|
152
|
-
* values in the array in order for the schema to be valid.
|
|
153
|
-
*
|
|
154
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
155
|
-
*/
|
|
156
|
-
enum?: JSONSchema4Type[];
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* @see https://json-schema.org/understanding-json-schema/reference/object.html
|
|
160
|
-
*/
|
|
161
|
-
export interface JSONSchema4ObjectSchema extends JSONSchema4Base {
|
|
162
|
-
type: 'object';
|
|
163
|
-
/**
|
|
164
|
-
* This attribute defines a schema for all properties that are not
|
|
165
|
-
* explicitly defined in an object type definition. If specified, the
|
|
166
|
-
* value MUST be a schema or a boolean. If false is provided, no
|
|
167
|
-
* additional properties are allowed beyond the properties defined in
|
|
168
|
-
* the schema. The default value is an empty schema which allows any
|
|
169
|
-
* value for additional properties.
|
|
170
|
-
*
|
|
171
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
|
|
172
|
-
*/
|
|
173
|
-
additionalProperties?: JSONSchema4 | boolean | undefined;
|
|
174
|
-
/**
|
|
175
|
-
* This attribute is an object with property definitions that define the
|
|
176
|
-
* valid values of instance object property values. When the instance
|
|
177
|
-
* value is an object, the property values of the instance object MUST
|
|
178
|
-
* conform to the property definitions in this object. In this object,
|
|
179
|
-
* each property definition's value MUST be a schema, and the property's
|
|
180
|
-
* name MUST be the name of the instance property that it defines. The
|
|
181
|
-
* instance property value MUST be valid according to the schema from
|
|
182
|
-
* the property definition. Properties are considered unordered, the
|
|
183
|
-
* order of the instance properties MAY be in any order.
|
|
184
|
-
*
|
|
185
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
|
|
186
|
-
*/
|
|
187
|
-
properties?: {
|
|
188
|
-
[k: string]: JSONSchema4;
|
|
189
|
-
} | 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?: {
|
|
202
|
-
[k: string]: JSONSchema4;
|
|
203
|
-
} | undefined;
|
|
204
|
-
/**
|
|
205
|
-
* The `dependencies` keyword conditionally applies a sub-schema when a given
|
|
206
|
-
* property is present. This schema is applied in the same way `allOf` applies
|
|
207
|
-
* schemas. Nothing is merged or extended. Both schemas apply independently.
|
|
208
|
-
*/
|
|
209
|
-
dependencies?: {
|
|
210
|
-
[k: string]: JSONSchema4 | string[];
|
|
211
|
-
} | undefined;
|
|
212
|
-
/**
|
|
213
|
-
* The maximum number of properties allowed for record-style schemas
|
|
214
|
-
*/
|
|
215
|
-
maxProperties?: number | undefined;
|
|
216
|
-
/**
|
|
217
|
-
* The minimum number of properties required for record-style schemas
|
|
218
|
-
*/
|
|
219
|
-
minProperties?: number | undefined;
|
|
220
|
-
}
|
|
221
|
-
/**
|
|
222
|
-
* @see https://json-schema.org/understanding-json-schema/reference/array.html
|
|
223
|
-
*/
|
|
224
|
-
export interface JSONSchema4ArraySchema extends JSONSchema4Base {
|
|
225
|
-
type: 'array';
|
|
226
|
-
/**
|
|
227
|
-
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
|
|
228
|
-
*
|
|
229
|
-
* This provides a definition for additional items in an array instance
|
|
230
|
-
* when tuple definitions of the items is provided. This can be false
|
|
231
|
-
* to indicate additional items in the array are not allowed, or it can
|
|
232
|
-
* be a schema that defines the schema of the additional items.
|
|
233
|
-
*
|
|
234
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
|
|
235
|
-
*/
|
|
236
|
-
additionalItems?: JSONSchema4 | boolean | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* This attribute defines the allowed items in an instance array, and
|
|
239
|
-
* MUST be a schema or an array of schemas. The default value is an
|
|
240
|
-
* empty schema which allows any value for items in the instance array.
|
|
241
|
-
*
|
|
242
|
-
* When this attribute value is a schema and the instance value is an
|
|
243
|
-
* array, then all the items in the array MUST be valid according to the
|
|
244
|
-
* schema.
|
|
245
|
-
*
|
|
246
|
-
* When this attribute value is an array of schemas and the instance
|
|
247
|
-
* value is an array, each position in the instance array MUST conform
|
|
248
|
-
* to the schema in the corresponding position for this array. This
|
|
249
|
-
* called tuple typing. When tuple typing is used, additional items are
|
|
250
|
-
* allowed, disallowed, or constrained by the "additionalItems"
|
|
251
|
-
* (Section 5.6) attribute using the same rules as
|
|
252
|
-
* "additionalProperties" (Section 5.4) for objects.
|
|
253
|
-
*
|
|
254
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
|
|
255
|
-
*/
|
|
256
|
-
items?: JSONSchema4 | JSONSchema4[] | undefined;
|
|
257
|
-
/**
|
|
258
|
-
* Defines the maximum length of an array
|
|
259
|
-
*/
|
|
260
|
-
maxItems?: number | undefined;
|
|
261
|
-
/**
|
|
262
|
-
* Defines the minimum length of an array
|
|
263
|
-
*/
|
|
264
|
-
minItems?: number | undefined;
|
|
265
|
-
/**
|
|
266
|
-
* Enforces that all items in the array are unique
|
|
267
|
-
*/
|
|
268
|
-
uniqueItems?: boolean | undefined;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* @see https://json-schema.org/understanding-json-schema/reference/string.html
|
|
272
|
-
*/
|
|
273
|
-
export interface JSONSchema4StringSchema extends JSONSchema4Base {
|
|
274
|
-
type: 'string';
|
|
275
|
-
/**
|
|
276
|
-
* The maximum allowed length for the string
|
|
277
|
-
*/
|
|
278
|
-
maxLength?: number | undefined;
|
|
279
|
-
/**
|
|
280
|
-
* The minimum allowed length for the string
|
|
281
|
-
*/
|
|
282
|
-
minLength?: number | undefined;
|
|
283
|
-
/**
|
|
284
|
-
* The `pattern` keyword is used to restrict a string to a particular regular
|
|
285
|
-
* expression. The regular expression syntax is the one defined in JavaScript
|
|
286
|
-
* (ECMA 262 specifically) with Unicode support.
|
|
287
|
-
*
|
|
288
|
-
* When defining the regular expressions, it’s important to note that the
|
|
289
|
-
* string is considered valid if the expression matches anywhere within the
|
|
290
|
-
* string. For example, the regular expression "p" will match any string with
|
|
291
|
-
* a p in it, such as "apple" not just a string that is simply "p". Therefore,
|
|
292
|
-
* it is usually less confusing, as a matter of course, to surround the
|
|
293
|
-
* regular expression in ^...$, for example, "^p$", unless there is a good
|
|
294
|
-
* reason not to do so.
|
|
295
|
-
*/
|
|
296
|
-
pattern?: string | undefined;
|
|
297
|
-
/**
|
|
298
|
-
* The `format` keyword allows for basic semantic identification of certain
|
|
299
|
-
* kinds of string values that are commonly used.
|
|
300
|
-
*
|
|
301
|
-
* For example, because JSON doesn’t have a “DateTime” type, dates need to be
|
|
302
|
-
* encoded as strings. `format` allows the schema author to indicate that the
|
|
303
|
-
* string value should be interpreted as a date.
|
|
304
|
-
*
|
|
305
|
-
* ajv v6 provides a few built-in formats - all other strings will cause AJV
|
|
306
|
-
* to throw during schema compilation
|
|
307
|
-
*/
|
|
308
|
-
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;
|
|
309
|
-
enum?: string[] | undefined;
|
|
310
|
-
}
|
|
311
|
-
/**
|
|
312
|
-
* @see https://json-schema.org/understanding-json-schema/reference/numeric.html
|
|
313
|
-
*/
|
|
314
|
-
export interface JSONSchema4NumberSchema extends JSONSchema4Base {
|
|
315
|
-
type: 'integer' | 'number';
|
|
316
|
-
/**
|
|
317
|
-
* Numbers can be restricted to a multiple of a given number, using the
|
|
318
|
-
* `multipleOf` keyword. It may be set to any positive number.
|
|
319
|
-
*/
|
|
320
|
-
multipleOf?: number | undefined;
|
|
321
|
-
/**
|
|
322
|
-
* The maximum allowed value for the number
|
|
323
|
-
*/
|
|
324
|
-
maximum?: number | undefined;
|
|
325
|
-
/**
|
|
326
|
-
* The minimum allowed value for the number
|
|
327
|
-
*/
|
|
328
|
-
minimum?: number | undefined;
|
|
329
|
-
/**
|
|
330
|
-
* The exclusive minimum allowed value for the number
|
|
331
|
-
* - `true` = `x < maximum`
|
|
332
|
-
* - `false` = `x <= maximum`
|
|
333
|
-
*
|
|
334
|
-
* Default is `false`
|
|
335
|
-
*/
|
|
336
|
-
exclusiveMaximum?: boolean | undefined;
|
|
337
|
-
/**
|
|
338
|
-
* Indicates whether or not `minimum` is the inclusive or exclusive minimum
|
|
339
|
-
* - `true` = `x > minimum`
|
|
340
|
-
* - `false` = `x ≥ minimum`
|
|
341
|
-
*
|
|
342
|
-
* Default is `false`
|
|
343
|
-
*/
|
|
344
|
-
exclusiveMinimum?: boolean | undefined;
|
|
345
|
-
/**
|
|
346
|
-
* This provides an enumeration of all possible values that are valid
|
|
347
|
-
* for the instance property. This MUST be an array, and each item in
|
|
348
|
-
* the array represents a possible value for the instance value. If
|
|
349
|
-
* this attribute is defined, the instance value MUST be one of the
|
|
350
|
-
* values in the array in order for the schema to be valid.
|
|
351
|
-
*
|
|
352
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
353
|
-
*/
|
|
354
|
-
enum?: number[] | undefined;
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* @see https://json-schema.org/understanding-json-schema/reference/boolean.html
|
|
358
|
-
*/
|
|
359
|
-
export interface JSONSchema4BoleanSchema extends JSONSchema4Base {
|
|
360
|
-
type: 'boolean';
|
|
361
|
-
/**
|
|
362
|
-
* This provides an enumeration of all possible values that are valid
|
|
363
|
-
* for the instance property. This MUST be an array, and each item in
|
|
364
|
-
* the array represents a possible value for the instance value. If
|
|
365
|
-
* this attribute is defined, the instance value MUST be one of the
|
|
366
|
-
* values in the array in order for the schema to be valid.
|
|
367
|
-
*
|
|
368
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
369
|
-
*/
|
|
370
|
-
enum?: boolean[] | undefined;
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* @see https://json-schema.org/understanding-json-schema/reference/null.html
|
|
374
|
-
*/
|
|
375
|
-
export interface JSONSchema4NullSchema extends JSONSchema4Base {
|
|
376
|
-
type: 'null';
|
|
377
|
-
/**
|
|
378
|
-
* This provides an enumeration of all possible values that are valid
|
|
379
|
-
* for the instance property. This MUST be an array, and each item in
|
|
380
|
-
* the array represents a possible value for the instance value. If
|
|
381
|
-
* this attribute is defined, the instance value MUST be one of the
|
|
382
|
-
* values in the array in order for the schema to be valid.
|
|
383
|
-
*
|
|
384
|
-
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
385
|
-
*/
|
|
386
|
-
enum?: null[] | undefined;
|
|
387
|
-
}
|
|
388
|
-
export interface JSONSchema4AnySchema extends JSONSchema4Base {
|
|
389
|
-
type: 'any';
|
|
390
|
-
}
|
|
391
|
-
export {};
|
|
392
|
-
//# 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
|