@interlace/eslint-devkit 2.1.2 → 2.2.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/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,389 @@
|
|
|
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
|
+
* This is a fork of https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13f63c2eb8d7479caf01ab8d72f9e3683368a8f5/types/json-schema/index.d.ts
|
|
5
|
+
* We intentionally fork this because:
|
|
6
|
+
* - ESLint ***ONLY*** supports JSONSchema v4
|
|
7
|
+
* - We want to provide stricter types
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
|
|
11
|
+
*/
|
|
12
|
+
export type JSONSchema4TypeName = 'any' | 'array' | 'boolean' | 'integer' | 'null' | 'number' | 'object' | 'string';
|
|
13
|
+
/**
|
|
14
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
|
|
15
|
+
*/
|
|
16
|
+
export type JSONSchema4Type = boolean | number | string | null;
|
|
17
|
+
export type JSONSchema4TypeExtended = JSONSchema4Array | JSONSchema4Object | JSONSchema4Type;
|
|
18
|
+
export interface JSONSchema4Object {
|
|
19
|
+
[key: string]: JSONSchema4TypeExtended;
|
|
20
|
+
}
|
|
21
|
+
export interface JSONSchema4Array extends Array<JSONSchema4TypeExtended> {
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Meta schema
|
|
25
|
+
*
|
|
26
|
+
* Recommended values:
|
|
27
|
+
* - 'http://json-schema.org/schema#'
|
|
28
|
+
* - 'http://json-schema.org/hyper-schema#'
|
|
29
|
+
* - 'http://json-schema.org/draft-04/schema#'
|
|
30
|
+
* - 'http://json-schema.org/draft-04/hyper-schema#'
|
|
31
|
+
* - 'http://json-schema.org/draft-03/schema#'
|
|
32
|
+
* - 'http://json-schema.org/draft-03/hyper-schema#'
|
|
33
|
+
*
|
|
34
|
+
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
|
|
35
|
+
*/
|
|
36
|
+
export type JSONSchema4Version = string;
|
|
37
|
+
/**
|
|
38
|
+
* JSON Schema V4
|
|
39
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
|
|
40
|
+
*/
|
|
41
|
+
export type JSONSchema4 = JSONSchema4AllOfSchema | JSONSchema4AnyOfSchema | JSONSchema4AnySchema | JSONSchema4ArraySchema | JSONSchema4BooleanSchema | JSONSchema4MultiSchema | JSONSchema4NullSchema | JSONSchema4NumberSchema | JSONSchema4ObjectSchema | JSONSchema4OneOfSchema | JSONSchema4RefSchema | JSONSchema4StringSchema;
|
|
42
|
+
interface JSONSchema4Base {
|
|
43
|
+
/**
|
|
44
|
+
* Reusable definitions that can be referenced via `$ref`
|
|
45
|
+
*/
|
|
46
|
+
$defs?: Record<string, JSONSchema4> | 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
|
+
$schema?: JSONSchema4Version | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* (AND) Must be valid against all of the sub-schemas
|
|
66
|
+
*/
|
|
67
|
+
allOf?: JSONSchema4[] | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* (OR) Must be valid against any of the sub-schemas
|
|
70
|
+
*/
|
|
71
|
+
anyOf?: JSONSchema4[] | undefined;
|
|
72
|
+
/**
|
|
73
|
+
* The default value for the item if not present
|
|
74
|
+
*/
|
|
75
|
+
default?: JSONSchema4TypeExtended | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* Reusable definitions that can be referenced via `$ref`
|
|
78
|
+
*/
|
|
79
|
+
definitions?: Record<string, JSONSchema4> | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* This attribute is a string that provides a full description of the of
|
|
82
|
+
* purpose the instance property.
|
|
83
|
+
*
|
|
84
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
|
|
85
|
+
*/
|
|
86
|
+
description?: string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The value of this property MUST be another schema which will provide
|
|
89
|
+
* a base schema which the current schema will inherit from. The
|
|
90
|
+
* inheritance rules are such that any instance that is valid according
|
|
91
|
+
* to the current schema MUST be valid according to the referenced
|
|
92
|
+
* schema. This MAY also be an array, in which case, the instance MUST
|
|
93
|
+
* be valid for all the schemas in the array. A schema that extends
|
|
94
|
+
* another schema MAY define additional attributes, constrain existing
|
|
95
|
+
* attributes, or add other constraints.
|
|
96
|
+
*
|
|
97
|
+
* Conceptually, the behavior of extends can be seen as validating an
|
|
98
|
+
* instance against all constraints in the extending schema as well as
|
|
99
|
+
* the extended schema(s).
|
|
100
|
+
*
|
|
101
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
|
|
102
|
+
*/
|
|
103
|
+
extends?: string | string[] | undefined;
|
|
104
|
+
id?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* (NOT) Must not be valid against the given schema
|
|
107
|
+
*/
|
|
108
|
+
not?: JSONSchema4 | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* (XOR) Must be valid against exactly one of the sub-schemas
|
|
111
|
+
*/
|
|
112
|
+
oneOf?: JSONSchema4[] | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* This attribute indicates if the instance must have a value, and not
|
|
115
|
+
* be undefined. This is false by default, making the instance
|
|
116
|
+
* optional.
|
|
117
|
+
*
|
|
118
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
|
|
119
|
+
*/
|
|
120
|
+
required?: boolean | string[] | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* This attribute is a string that provides a short description of the
|
|
123
|
+
* instance property.
|
|
124
|
+
*
|
|
125
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
|
|
126
|
+
*/
|
|
127
|
+
title?: string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* A single type, or a union of simple types
|
|
130
|
+
*/
|
|
131
|
+
type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;
|
|
132
|
+
}
|
|
133
|
+
export interface JSONSchema4RefSchema extends JSONSchema4Base {
|
|
134
|
+
$ref: string;
|
|
135
|
+
type?: undefined;
|
|
136
|
+
}
|
|
137
|
+
export interface JSONSchema4AllOfSchema extends JSONSchema4Base {
|
|
138
|
+
allOf: JSONSchema4[];
|
|
139
|
+
type?: undefined;
|
|
140
|
+
}
|
|
141
|
+
export interface JSONSchema4AnyOfSchema extends JSONSchema4Base {
|
|
142
|
+
anyOf: JSONSchema4[];
|
|
143
|
+
type?: undefined;
|
|
144
|
+
}
|
|
145
|
+
export interface JSONSchema4OneOfSchema extends JSONSchema4Base {
|
|
146
|
+
oneOf: JSONSchema4[];
|
|
147
|
+
type?: undefined;
|
|
148
|
+
}
|
|
149
|
+
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'> {
|
|
150
|
+
/**
|
|
151
|
+
* This provides an enumeration of all possible values that are valid
|
|
152
|
+
* for the instance property. This MUST be an array, and each item in
|
|
153
|
+
* the array represents a possible value for the instance value. If
|
|
154
|
+
* this attribute is defined, the instance value MUST be one of the
|
|
155
|
+
* values in the array in order for the schema to be valid.
|
|
156
|
+
*
|
|
157
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
158
|
+
*/
|
|
159
|
+
enum?: JSONSchema4Type[];
|
|
160
|
+
type: JSONSchema4TypeName[];
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* @see https://json-schema.org/understanding-json-schema/reference/object.html
|
|
164
|
+
*/
|
|
165
|
+
export interface JSONSchema4ObjectSchema extends JSONSchema4Base {
|
|
166
|
+
/**
|
|
167
|
+
* This attribute defines a schema for all properties that are not
|
|
168
|
+
* explicitly defined in an object type definition. If specified, the
|
|
169
|
+
* value MUST be a schema or a boolean. If false is provided, no
|
|
170
|
+
* additional properties are allowed beyond the properties defined in
|
|
171
|
+
* the schema. The default value is an empty schema which allows any
|
|
172
|
+
* value for additional properties.
|
|
173
|
+
*
|
|
174
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
|
|
175
|
+
*/
|
|
176
|
+
additionalProperties?: boolean | JSONSchema4 | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* The `dependencies` keyword conditionally applies a sub-schema when a given
|
|
179
|
+
* property is present. This schema is applied in the same way `allOf` applies
|
|
180
|
+
* schemas. Nothing is merged or extended. Both schemas apply independently.
|
|
181
|
+
*/
|
|
182
|
+
dependencies?: Record<string, JSONSchema4 | string[]> | undefined;
|
|
183
|
+
/**
|
|
184
|
+
* The maximum number of properties allowed for record-style schemas
|
|
185
|
+
*/
|
|
186
|
+
maxProperties?: number | undefined;
|
|
187
|
+
/**
|
|
188
|
+
* The minimum number of properties required for record-style schemas
|
|
189
|
+
*/
|
|
190
|
+
minProperties?: number | undefined;
|
|
191
|
+
/**
|
|
192
|
+
* This attribute is an object that defines the schema for a set of
|
|
193
|
+
* property names of an object instance. The name of each property of
|
|
194
|
+
* this attribute's object is a regular expression pattern in the ECMA
|
|
195
|
+
* 262/Perl 5 format, while the value is a schema. If the pattern
|
|
196
|
+
* matches the name of a property on the instance object, the value of
|
|
197
|
+
* the instance's property MUST be valid against the pattern name's
|
|
198
|
+
* schema value.
|
|
199
|
+
*
|
|
200
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
|
|
201
|
+
*/
|
|
202
|
+
patternProperties?: Record<string, JSONSchema4> | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* This attribute is an object with property definitions that define the
|
|
205
|
+
* valid values of instance object property values. When the instance
|
|
206
|
+
* value is an object, the property values of the instance object MUST
|
|
207
|
+
* conform to the property definitions in this object. In this object,
|
|
208
|
+
* each property definition's value MUST be a schema, and the property's
|
|
209
|
+
* name MUST be the name of the instance property that it defines. The
|
|
210
|
+
* instance property value MUST be valid according to the schema from
|
|
211
|
+
* the property definition. Properties are considered unordered, the
|
|
212
|
+
* order of the instance properties MAY be in any order.
|
|
213
|
+
*
|
|
214
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
|
|
215
|
+
*/
|
|
216
|
+
properties?: Record<string, JSONSchema4> | undefined;
|
|
217
|
+
type: 'object';
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* @see https://json-schema.org/understanding-json-schema/reference/array.html
|
|
221
|
+
*/
|
|
222
|
+
export interface JSONSchema4ArraySchema extends JSONSchema4Base {
|
|
223
|
+
/**
|
|
224
|
+
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
|
|
225
|
+
*
|
|
226
|
+
* This provides a definition for additional items in an array instance
|
|
227
|
+
* when tuple definitions of the items is provided. This can be false
|
|
228
|
+
* to indicate additional items in the array are not allowed, or it can
|
|
229
|
+
* be a schema that defines the schema of the additional items.
|
|
230
|
+
*
|
|
231
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
|
|
232
|
+
*/
|
|
233
|
+
additionalItems?: boolean | JSONSchema4 | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* This attribute defines the allowed items in an instance array, and
|
|
236
|
+
* MUST be a schema or an array of schemas. The default value is an
|
|
237
|
+
* empty schema which allows any value for items in the instance array.
|
|
238
|
+
*
|
|
239
|
+
* When this attribute value is a schema and the instance value is an
|
|
240
|
+
* array, then all the items in the array MUST be valid according to the
|
|
241
|
+
* schema.
|
|
242
|
+
*
|
|
243
|
+
* When this attribute value is an array of schemas and the instance
|
|
244
|
+
* value is an array, each position in the instance array MUST conform
|
|
245
|
+
* to the schema in the corresponding position for this array. This
|
|
246
|
+
* called tuple typing. When tuple typing is used, additional items are
|
|
247
|
+
* allowed, disallowed, or constrained by the "additionalItems"
|
|
248
|
+
* (Section 5.6) attribute using the same rules as
|
|
249
|
+
* "additionalProperties" (Section 5.4) for objects.
|
|
250
|
+
*
|
|
251
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
|
|
252
|
+
*/
|
|
253
|
+
items?: JSONSchema4 | JSONSchema4[] | undefined;
|
|
254
|
+
/**
|
|
255
|
+
* Defines the maximum length of an array
|
|
256
|
+
*/
|
|
257
|
+
maxItems?: number | undefined;
|
|
258
|
+
/**
|
|
259
|
+
* Defines the minimum length of an array
|
|
260
|
+
*/
|
|
261
|
+
minItems?: number | undefined;
|
|
262
|
+
type: 'array';
|
|
263
|
+
/**
|
|
264
|
+
* Enforces that all items in the array are unique
|
|
265
|
+
*/
|
|
266
|
+
uniqueItems?: boolean | undefined;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* @see https://json-schema.org/understanding-json-schema/reference/string.html
|
|
270
|
+
*/
|
|
271
|
+
export interface JSONSchema4StringSchema extends JSONSchema4Base {
|
|
272
|
+
enum?: string[] | undefined;
|
|
273
|
+
/**
|
|
274
|
+
* The `format` keyword allows for basic semantic identification of certain
|
|
275
|
+
* kinds of string values that are commonly used.
|
|
276
|
+
*
|
|
277
|
+
* For example, because JSON doesn’t have a “DateTime” type, dates need to be
|
|
278
|
+
* encoded as strings. `format` allows the schema author to indicate that the
|
|
279
|
+
* string value should be interpreted as a date.
|
|
280
|
+
*
|
|
281
|
+
* ajv v6 provides a few built-in formats - all other strings will cause AJV
|
|
282
|
+
* to throw during schema compilation
|
|
283
|
+
*/
|
|
284
|
+
format?: 'date' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'json-pointer' | 'json-pointer-uri-fragment' | 'regex' | 'relative-json-pointer' | 'time' | 'uri' | 'uri-reference' | 'uri-template' | 'url' | 'uuid' | undefined;
|
|
285
|
+
/**
|
|
286
|
+
* The maximum allowed length for the string
|
|
287
|
+
*/
|
|
288
|
+
maxLength?: number | undefined;
|
|
289
|
+
/**
|
|
290
|
+
* The minimum allowed length for the string
|
|
291
|
+
*/
|
|
292
|
+
minLength?: number | undefined;
|
|
293
|
+
/**
|
|
294
|
+
* The `pattern` keyword is used to restrict a string to a particular regular
|
|
295
|
+
* expression. The regular expression syntax is the one defined in JavaScript
|
|
296
|
+
* (ECMA 262 specifically) with Unicode support.
|
|
297
|
+
*
|
|
298
|
+
* When defining the regular expressions, it’s important to note that the
|
|
299
|
+
* string is considered valid if the expression matches anywhere within the
|
|
300
|
+
* string. For example, the regular expression "p" will match any string with
|
|
301
|
+
* a p in it, such as "apple" not just a string that is simply "p". Therefore,
|
|
302
|
+
* it is usually less confusing, as a matter of course, to surround the
|
|
303
|
+
* regular expression in ^...$, for example, "^p$", unless there is a good
|
|
304
|
+
* reason not to do so.
|
|
305
|
+
*/
|
|
306
|
+
pattern?: string | undefined;
|
|
307
|
+
type: 'string';
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* @see https://json-schema.org/understanding-json-schema/reference/numeric.html
|
|
311
|
+
*/
|
|
312
|
+
export interface JSONSchema4NumberSchema extends JSONSchema4Base {
|
|
313
|
+
/**
|
|
314
|
+
* This provides an enumeration of all possible values that are valid
|
|
315
|
+
* for the instance property. This MUST be an array, and each item in
|
|
316
|
+
* the array represents a possible value for the instance value. If
|
|
317
|
+
* this attribute is defined, the instance value MUST be one of the
|
|
318
|
+
* values in the array in order for the schema to be valid.
|
|
319
|
+
*
|
|
320
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
321
|
+
*/
|
|
322
|
+
enum?: number[] | undefined;
|
|
323
|
+
/**
|
|
324
|
+
* The exclusive minimum allowed value for the number
|
|
325
|
+
* - `true` = `x < maximum`
|
|
326
|
+
* - `false` = `x <= maximum`
|
|
327
|
+
*
|
|
328
|
+
* Default is `false`
|
|
329
|
+
*/
|
|
330
|
+
exclusiveMaximum?: boolean | undefined;
|
|
331
|
+
/**
|
|
332
|
+
* Indicates whether or not `minimum` is the inclusive or exclusive minimum
|
|
333
|
+
* - `true` = `x > minimum`
|
|
334
|
+
* - `false` = `x ≥ minimum`
|
|
335
|
+
*
|
|
336
|
+
* Default is `false`
|
|
337
|
+
*/
|
|
338
|
+
exclusiveMinimum?: boolean | undefined;
|
|
339
|
+
/**
|
|
340
|
+
* The maximum allowed value for the number
|
|
341
|
+
*/
|
|
342
|
+
maximum?: number | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* The minimum allowed value for the number
|
|
345
|
+
*/
|
|
346
|
+
minimum?: number | undefined;
|
|
347
|
+
/**
|
|
348
|
+
* Numbers can be restricted to a multiple of a given number, using the
|
|
349
|
+
* `multipleOf` keyword. It may be set to any positive number.
|
|
350
|
+
*/
|
|
351
|
+
multipleOf?: number | undefined;
|
|
352
|
+
type: 'integer' | 'number';
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* @see https://json-schema.org/understanding-json-schema/reference/boolean.html
|
|
356
|
+
*/
|
|
357
|
+
export interface JSONSchema4BooleanSchema extends JSONSchema4Base {
|
|
358
|
+
/**
|
|
359
|
+
* This provides an enumeration of all possible values that are valid
|
|
360
|
+
* for the instance property. This MUST be an array, and each item in
|
|
361
|
+
* the array represents a possible value for the instance value. If
|
|
362
|
+
* this attribute is defined, the instance value MUST be one of the
|
|
363
|
+
* values in the array in order for the schema to be valid.
|
|
364
|
+
*
|
|
365
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
366
|
+
*/
|
|
367
|
+
enum?: boolean[] | undefined;
|
|
368
|
+
type: 'boolean';
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* @see https://json-schema.org/understanding-json-schema/reference/null.html
|
|
372
|
+
*/
|
|
373
|
+
export interface JSONSchema4NullSchema extends JSONSchema4Base {
|
|
374
|
+
/**
|
|
375
|
+
* This provides an enumeration of all possible values that are valid
|
|
376
|
+
* for the instance property. This MUST be an array, and each item in
|
|
377
|
+
* the array represents a possible value for the instance value. If
|
|
378
|
+
* this attribute is defined, the instance value MUST be one of the
|
|
379
|
+
* values in the array in order for the schema to be valid.
|
|
380
|
+
*
|
|
381
|
+
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
|
382
|
+
*/
|
|
383
|
+
enum?: null[] | undefined;
|
|
384
|
+
type: 'null';
|
|
385
|
+
}
|
|
386
|
+
export interface JSONSchema4AnySchema extends JSONSchema4Base {
|
|
387
|
+
type: 'any';
|
|
388
|
+
}
|
|
389
|
+
export {};
|
|
@@ -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
|
+
import type { AST_TOKEN_TYPES, TSESTree } from '../ts-estree';
|
|
4
|
+
declare namespace AST {
|
|
5
|
+
type TokenType = AST_TOKEN_TYPES;
|
|
6
|
+
type Token = TSESTree.Token;
|
|
7
|
+
type SourceLocation = TSESTree.SourceLocation;
|
|
8
|
+
type Range = TSESTree.Range;
|
|
9
|
+
}
|
|
10
|
+
export type { AST };
|
|
@@ -0,0 +1,293 @@
|
|
|
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 { Parser as ParserType } from './Parser';
|
|
4
|
+
import type * as ParserOptionsTypes from './ParserOptions';
|
|
5
|
+
import type { Processor as ProcessorType } from './Processor';
|
|
6
|
+
import type { LooseRuleDefinition, SharedConfigurationSettings } from './Rule';
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare namespace SharedConfig {
|
|
9
|
+
type Severity = 0 | 1 | 2;
|
|
10
|
+
type SeverityString = 'error' | 'off' | 'warn';
|
|
11
|
+
type RuleLevel = Severity | SeverityString;
|
|
12
|
+
type RuleLevelAndOptions = [RuleLevel, ...unknown[]];
|
|
13
|
+
type RuleEntry = RuleLevel | RuleLevelAndOptions;
|
|
14
|
+
type RulesRecord = Partial<Record<string, RuleEntry>>;
|
|
15
|
+
type GlobalVariableOptionBase = 'off' | /** @deprecated use `'readonly'` */ 'readable' | 'readonly' | 'writable' | /** @deprecated use `'writable'` */ 'writeable';
|
|
16
|
+
type GlobalVariableOptionBoolean = /** @deprecated use `'readonly'` */ false | /** @deprecated use `'writable'` */ true;
|
|
17
|
+
type GlobalVariableOption = GlobalVariableOptionBase | GlobalVariableOptionBoolean;
|
|
18
|
+
interface GlobalsConfig {
|
|
19
|
+
[name: string]: GlobalVariableOption;
|
|
20
|
+
}
|
|
21
|
+
interface EnvironmentConfig {
|
|
22
|
+
[name: string]: boolean;
|
|
23
|
+
}
|
|
24
|
+
type ParserOptions = ParserOptionsTypes.ParserOptions;
|
|
25
|
+
interface PluginMeta {
|
|
26
|
+
/**
|
|
27
|
+
* The meta.name property should match the npm package name for your plugin.
|
|
28
|
+
*/
|
|
29
|
+
name: string;
|
|
30
|
+
/**
|
|
31
|
+
* If you followed the classic style to name your package
|
|
32
|
+
* (e.g. `eslint-plugin-X`, `@X/eslint-plugin`, or `@X/eslint-plugin-Y`),
|
|
33
|
+
* then this should match the classic namespace inferred for your package
|
|
34
|
+
* (e.g. `X`, `@X`, or `@X/Y`, respectively).
|
|
35
|
+
*/
|
|
36
|
+
namespace?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The meta.version property should match the npm package version for your plugin.
|
|
39
|
+
*/
|
|
40
|
+
version: string;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export declare namespace ClassicConfig {
|
|
44
|
+
export type EnvironmentConfig = SharedConfig.EnvironmentConfig;
|
|
45
|
+
export type GlobalsConfig = SharedConfig.GlobalsConfig;
|
|
46
|
+
export type GlobalVariableOption = SharedConfig.GlobalVariableOption;
|
|
47
|
+
export type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
|
|
48
|
+
export type ParserOptions = SharedConfig.ParserOptions;
|
|
49
|
+
export type RuleEntry = SharedConfig.RuleEntry;
|
|
50
|
+
export type RuleLevel = SharedConfig.RuleLevel;
|
|
51
|
+
export type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
|
|
52
|
+
export type RulesRecord = SharedConfig.RulesRecord;
|
|
53
|
+
export type Severity = SharedConfig.Severity;
|
|
54
|
+
export type SeverityString = SharedConfig.SeverityString;
|
|
55
|
+
interface BaseConfig {
|
|
56
|
+
$schema?: string;
|
|
57
|
+
/**
|
|
58
|
+
* The environment settings.
|
|
59
|
+
*/
|
|
60
|
+
env?: EnvironmentConfig;
|
|
61
|
+
/**
|
|
62
|
+
* The path to other config files or the package name of shareable configs.
|
|
63
|
+
*/
|
|
64
|
+
extends?: string | string[];
|
|
65
|
+
/**
|
|
66
|
+
* The global variable settings.
|
|
67
|
+
*/
|
|
68
|
+
globals?: GlobalsConfig;
|
|
69
|
+
/**
|
|
70
|
+
* The flag that disables comment directives.
|
|
71
|
+
*/
|
|
72
|
+
noInlineConfig?: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* The override settings per kind of files.
|
|
75
|
+
*/
|
|
76
|
+
overrides?: ConfigOverride[];
|
|
77
|
+
/**
|
|
78
|
+
* The path to a parser or the package name of a parser.
|
|
79
|
+
*/
|
|
80
|
+
parser?: string | null;
|
|
81
|
+
/**
|
|
82
|
+
* The parser options.
|
|
83
|
+
*/
|
|
84
|
+
parserOptions?: ParserOptions;
|
|
85
|
+
/**
|
|
86
|
+
* The plugin specifiers.
|
|
87
|
+
*/
|
|
88
|
+
plugins?: string[];
|
|
89
|
+
/**
|
|
90
|
+
* The processor specifier.
|
|
91
|
+
*/
|
|
92
|
+
processor?: string;
|
|
93
|
+
/**
|
|
94
|
+
* The flag to report unused `eslint-disable` comments.
|
|
95
|
+
*/
|
|
96
|
+
reportUnusedDisableDirectives?: boolean;
|
|
97
|
+
/**
|
|
98
|
+
* The rule settings.
|
|
99
|
+
*/
|
|
100
|
+
rules?: RulesRecord;
|
|
101
|
+
/**
|
|
102
|
+
* The shared settings.
|
|
103
|
+
*/
|
|
104
|
+
settings?: SharedConfigurationSettings;
|
|
105
|
+
}
|
|
106
|
+
export interface ConfigOverride extends BaseConfig {
|
|
107
|
+
excludedFiles?: string | string[];
|
|
108
|
+
files: string | string[];
|
|
109
|
+
}
|
|
110
|
+
export interface Config extends BaseConfig {
|
|
111
|
+
/**
|
|
112
|
+
* The glob patterns that ignore to lint.
|
|
113
|
+
*/
|
|
114
|
+
ignorePatterns?: string | string[];
|
|
115
|
+
/**
|
|
116
|
+
* The root flag.
|
|
117
|
+
*/
|
|
118
|
+
root?: boolean;
|
|
119
|
+
}
|
|
120
|
+
export {};
|
|
121
|
+
}
|
|
122
|
+
export declare namespace FlatConfig {
|
|
123
|
+
type EcmaVersion = ParserOptionsTypes.EcmaVersion;
|
|
124
|
+
type GlobalsConfig = SharedConfig.GlobalsConfig;
|
|
125
|
+
type Parser = ParserType.LooseParserModule;
|
|
126
|
+
type ParserOptions = SharedConfig.ParserOptions;
|
|
127
|
+
type PluginMeta = SharedConfig.PluginMeta;
|
|
128
|
+
type Processor = ProcessorType.LooseProcessorModule;
|
|
129
|
+
type RuleEntry = SharedConfig.RuleEntry;
|
|
130
|
+
type RuleLevel = SharedConfig.RuleLevel;
|
|
131
|
+
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
|
|
132
|
+
type Rules = SharedConfig.RulesRecord;
|
|
133
|
+
type Settings = SharedConfigurationSettings;
|
|
134
|
+
type Severity = SharedConfig.Severity;
|
|
135
|
+
type SeverityString = SharedConfig.SeverityString;
|
|
136
|
+
type SourceType = 'commonjs' | ParserOptionsTypes.SourceType;
|
|
137
|
+
interface SharedConfigs {
|
|
138
|
+
[key: string]: Config | ConfigArray;
|
|
139
|
+
}
|
|
140
|
+
interface Plugin {
|
|
141
|
+
/**
|
|
142
|
+
* Shared configurations bundled with the plugin.
|
|
143
|
+
* Users will reference these directly in their config (i.e. `plugin.configs.recommended`).
|
|
144
|
+
*/
|
|
145
|
+
configs?: SharedConfigs;
|
|
146
|
+
/**
|
|
147
|
+
* Metadata about your plugin for easier debugging and more effective caching of plugins.
|
|
148
|
+
*/
|
|
149
|
+
meta?: {
|
|
150
|
+
[K in keyof PluginMeta]?: PluginMeta[K] | undefined;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* The definition of plugin processors.
|
|
154
|
+
* Users can stringly reference the processor using the key in their config (i.e., `"pluginName/processorName"`).
|
|
155
|
+
*/
|
|
156
|
+
processors?: Partial<Record<string, Processor>> | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* The definition of plugin rules.
|
|
159
|
+
* The key must be the name of the rule that users will use
|
|
160
|
+
* Users can stringly reference the rule using the key they registered the plugin under combined with the rule name.
|
|
161
|
+
* i.e. for the user config `plugins: { foo: pluginReference }` - the reference would be `"foo/ruleName"`.
|
|
162
|
+
*/
|
|
163
|
+
rules?: Record<string, LooseRuleDefinition> | undefined;
|
|
164
|
+
}
|
|
165
|
+
interface Plugins {
|
|
166
|
+
/**
|
|
167
|
+
* We intentionally omit the `configs` key from this object because it avoids
|
|
168
|
+
* type conflicts with old plugins that haven't updated their configs to flat configs yet.
|
|
169
|
+
* It's valid to reference these old plugins because ESLint won't access the
|
|
170
|
+
* `.config` property of a plugin when evaluating a flat config.
|
|
171
|
+
*/
|
|
172
|
+
[pluginAlias: string]: Omit<Plugin, 'configs'>;
|
|
173
|
+
}
|
|
174
|
+
interface LinterOptions {
|
|
175
|
+
/**
|
|
176
|
+
* A Boolean value indicating if inline configuration is allowed.
|
|
177
|
+
*/
|
|
178
|
+
noInlineConfig?: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* A severity string indicating if and how unused disable and enable
|
|
181
|
+
* directives should be tracked and reported. For legacy compatibility, `true`
|
|
182
|
+
* is equivalent to `"warn"` and `false` is equivalent to `"off"`.
|
|
183
|
+
* @default "warn"
|
|
184
|
+
*/
|
|
185
|
+
reportUnusedDisableDirectives?: boolean | SharedConfig.Severity | SharedConfig.SeverityString;
|
|
186
|
+
/**
|
|
187
|
+
* A severity string indicating if and how unused inline directives
|
|
188
|
+
* should be tracked and reported.
|
|
189
|
+
*
|
|
190
|
+
* since ESLint 9.19.0
|
|
191
|
+
* @default "off"
|
|
192
|
+
*/
|
|
193
|
+
reportUnusedInlineConfigs?: SharedConfig.Severity | SharedConfig.SeverityString;
|
|
194
|
+
}
|
|
195
|
+
interface LanguageOptions {
|
|
196
|
+
/**
|
|
197
|
+
* The version of ECMAScript to support.
|
|
198
|
+
* May be any year (i.e., `2022`) or version (i.e., `5`).
|
|
199
|
+
* Set to `"latest"` for the most recent supported version.
|
|
200
|
+
* @default "latest"
|
|
201
|
+
*/
|
|
202
|
+
ecmaVersion?: EcmaVersion | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* An object specifying additional objects that should be added to the global scope during linting.
|
|
205
|
+
*/
|
|
206
|
+
globals?: GlobalsConfig | undefined;
|
|
207
|
+
/**
|
|
208
|
+
* An object containing a `parse()` method or a `parseForESLint()` method.
|
|
209
|
+
* @default
|
|
210
|
+
* ```
|
|
211
|
+
* // https://github.com/eslint/espree
|
|
212
|
+
* require('espree')
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
parser?: Parser | undefined;
|
|
216
|
+
/**
|
|
217
|
+
* An object specifying additional options that are passed directly to the parser.
|
|
218
|
+
* The available options are parser-dependent.
|
|
219
|
+
*/
|
|
220
|
+
parserOptions?: ParserOptions | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* The type of JavaScript source code.
|
|
223
|
+
* Possible values are `"script"` for traditional script files, `"module"` for ECMAScript modules (ESM), and `"commonjs"` for CommonJS files.
|
|
224
|
+
* @default
|
|
225
|
+
* ```
|
|
226
|
+
* // for `.js` and `.mjs` files
|
|
227
|
+
* "module"
|
|
228
|
+
* // for `.cjs` files
|
|
229
|
+
* "commonjs"
|
|
230
|
+
* ```
|
|
231
|
+
*/
|
|
232
|
+
sourceType?: SourceType | undefined;
|
|
233
|
+
}
|
|
234
|
+
interface Config {
|
|
235
|
+
/**
|
|
236
|
+
* The base path for files and ignores.
|
|
237
|
+
*
|
|
238
|
+
* Note that this is not permitted inside an `extends` array.
|
|
239
|
+
*
|
|
240
|
+
* Since ESLint 9.30.0
|
|
241
|
+
*/
|
|
242
|
+
basePath?: string;
|
|
243
|
+
/**
|
|
244
|
+
* An array of glob patterns indicating the files that the configuration object should apply to.
|
|
245
|
+
* If not specified, the configuration object applies to all files matched by any other configuration object.
|
|
246
|
+
*/
|
|
247
|
+
files?: (string | string[])[];
|
|
248
|
+
/**
|
|
249
|
+
* An array of glob patterns indicating the files that the configuration object should not apply to.
|
|
250
|
+
* If not specified, the configuration object applies to all files matched by files.
|
|
251
|
+
*/
|
|
252
|
+
ignores?: string[];
|
|
253
|
+
/**
|
|
254
|
+
* Language specifier in the form `namespace/language-name` where `namespace` is a plugin name set in the `plugins` field.
|
|
255
|
+
*/
|
|
256
|
+
language?: string;
|
|
257
|
+
/**
|
|
258
|
+
* An object containing settings related to how JavaScript is configured for linting.
|
|
259
|
+
*/
|
|
260
|
+
languageOptions?: LanguageOptions;
|
|
261
|
+
/**
|
|
262
|
+
* An object containing settings related to the linting process.
|
|
263
|
+
*/
|
|
264
|
+
linterOptions?: LinterOptions;
|
|
265
|
+
/**
|
|
266
|
+
* An string to identify the configuration object. Used in error messages and inspection tools.
|
|
267
|
+
*/
|
|
268
|
+
name?: string;
|
|
269
|
+
/**
|
|
270
|
+
* An object containing a name-value mapping of plugin names to plugin objects.
|
|
271
|
+
* When `files` is specified, these plugins are only available to the matching files.
|
|
272
|
+
*/
|
|
273
|
+
plugins?: Plugins;
|
|
274
|
+
/**
|
|
275
|
+
* Either an object containing `preprocess()` and `postprocess()` methods or
|
|
276
|
+
* a string indicating the name of a processor inside of a plugin
|
|
277
|
+
* (i.e., `"pluginName/processorName"`).
|
|
278
|
+
*/
|
|
279
|
+
processor?: string | Processor;
|
|
280
|
+
/**
|
|
281
|
+
* An object containing the configured rules.
|
|
282
|
+
* When `files` or `ignores` are specified, these rule configurations are only available to the matching files.
|
|
283
|
+
*/
|
|
284
|
+
rules?: Rules;
|
|
285
|
+
/**
|
|
286
|
+
* An object containing name-value pairs of information that should be available to all rules.
|
|
287
|
+
*/
|
|
288
|
+
settings?: Settings;
|
|
289
|
+
}
|
|
290
|
+
type ConfigArray = Config[];
|
|
291
|
+
type ConfigPromise = Promise<ConfigArray>;
|
|
292
|
+
type ConfigFile = ConfigArray | ConfigPromise;
|
|
293
|
+
}
|