@eslint-react/kit 1.52.9 → 1.52.10-beta.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.
- package/dist/chunk-B9dir_RE.mjs +11 -0
- package/dist/index.d.mts +113 -120
- package/dist/index.d.ts +115 -120
- package/dist/index.js +303 -187
- package/dist/index.mjs +250 -185
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { TSESTree } from
|
|
1
|
+
import { unit } from "@eslint-react/eff";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import * as typescript0 from "typescript";
|
|
4
|
+
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
5
|
+
import { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint";
|
|
6
|
+
import { TSESTree } from "@typescript-eslint/utils";
|
|
7
7
|
|
|
8
|
+
//#region src/types.d.ts
|
|
8
9
|
/**
|
|
9
10
|
* Rule severity.
|
|
10
11
|
* @since 0.0.1
|
|
11
12
|
*/
|
|
12
|
-
type
|
|
13
|
+
type SeverityName = "off" | "warn" | "error";
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
15
|
+
* The numeric severity level for a rule.
|
|
16
|
+
*
|
|
17
|
+
* - `0` means off.
|
|
18
|
+
* - `1` means warn.
|
|
19
|
+
* - `2` means error.
|
|
17
20
|
*/
|
|
18
|
-
type
|
|
21
|
+
type SeverityLevel = 0 | 1 | 2;
|
|
19
22
|
/**
|
|
20
|
-
*
|
|
23
|
+
* The severity of a rule in a configuration.
|
|
24
|
+
*/
|
|
25
|
+
type Severity = SeverityName | SeverityLevel;
|
|
26
|
+
/**
|
|
27
|
+
* Rule declaration.
|
|
28
|
+
* @internal
|
|
21
29
|
* @since 0.0.1
|
|
22
30
|
*/
|
|
23
|
-
type
|
|
31
|
+
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
|
|
24
32
|
/**
|
|
25
33
|
* Rule context.
|
|
26
34
|
* @since 0.0.1
|
|
@@ -31,20 +39,49 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
31
39
|
* @since 1.20.0
|
|
32
40
|
*/
|
|
33
41
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
|
-
|
|
42
|
+
type RulePolicy = number;
|
|
43
|
+
type RuleSuggest<MessageIds extends string = string> = {
|
|
44
|
+
messageId: MessageIds;
|
|
45
|
+
data?: Record<string, unknown>;
|
|
46
|
+
fix: tseslint.ReportFixFunction;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* A collection of settings.
|
|
50
|
+
*/
|
|
51
|
+
interface SettingsConfig {
|
|
52
|
+
[key: string]: unknown;
|
|
53
|
+
}
|
|
54
|
+
interface CompatibleRule {
|
|
55
|
+
meta: Record<string, any>;
|
|
56
|
+
create: (...args: any[]) => any;
|
|
57
|
+
}
|
|
58
|
+
interface CompatiblePlugin {
|
|
59
|
+
meta: {
|
|
60
|
+
name: string;
|
|
61
|
+
version: string;
|
|
62
|
+
};
|
|
63
|
+
rules: Record<string, CompatibleRule>;
|
|
64
|
+
}
|
|
65
|
+
interface CompatibleConfig {
|
|
66
|
+
name?: string;
|
|
67
|
+
rules?: Record<string, RuleConfig>;
|
|
68
|
+
settings?: SettingsConfig;
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/JsxConfig/JsxConfig.d.ts
|
|
35
72
|
declare const JsxEmit: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
73
|
+
readonly None: 0;
|
|
74
|
+
readonly Preserve: 1;
|
|
75
|
+
readonly React: 2;
|
|
76
|
+
readonly ReactNative: 3;
|
|
77
|
+
readonly ReactJSX: 4;
|
|
78
|
+
readonly ReactJSXDev: 5;
|
|
42
79
|
};
|
|
43
80
|
interface JsxConfig {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
81
|
+
jsx?: number;
|
|
82
|
+
jsxFactory?: string;
|
|
83
|
+
jsxFragmentFactory?: string;
|
|
84
|
+
jsxImportSource?: string;
|
|
48
85
|
}
|
|
49
86
|
/**
|
|
50
87
|
* Create a JsxConfig object
|
|
@@ -57,11 +94,11 @@ declare function make$2(): JsxConfig;
|
|
|
57
94
|
* @returns JsxConfig
|
|
58
95
|
*/
|
|
59
96
|
declare function getFromContext$1(context: RuleContext): {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
97
|
+
jsx: 4 | typescript0.JsxEmit;
|
|
98
|
+
jsxFactory: string;
|
|
99
|
+
jsxFragmentFactory: string;
|
|
100
|
+
jsxImportSource: string;
|
|
101
|
+
reactNamespace: string;
|
|
65
102
|
};
|
|
66
103
|
/**
|
|
67
104
|
* Get JsxConfig from annotation
|
|
@@ -69,26 +106,24 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
69
106
|
* @returns JsxConfig
|
|
70
107
|
*/
|
|
71
108
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
75
|
-
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
76
|
-
declare namespace index$1 {
|
|
77
|
-
export { type index$1_JsxConfig as JsxConfig, index$1_JsxEmit as JsxEmit, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
109
|
+
declare namespace index_d_exports {
|
|
110
|
+
export { JsxConfig, JsxEmit, getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
78
111
|
}
|
|
79
|
-
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region src/LanguagePreference/LanguagePreferenceSchema.d.ts
|
|
80
114
|
/**
|
|
81
115
|
* @internal
|
|
82
116
|
*/
|
|
83
117
|
declare const LanguagePreferenceSchema: z.ZodObject<{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
118
|
+
indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
|
|
119
|
+
indentWidth: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
121
|
+
semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
|
|
122
|
+
trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
|
|
123
|
+
jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
90
124
|
}, z.core.$strip>;
|
|
91
|
-
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region src/LanguagePreference/LanguagePreference.d.ts
|
|
92
127
|
/**
|
|
93
128
|
* @internal
|
|
94
129
|
*/
|
|
@@ -101,27 +136,23 @@ declare function make$1(): LanguagePreference;
|
|
|
101
136
|
* A default LanguagePreference object.
|
|
102
137
|
*/
|
|
103
138
|
declare const defaultLanguagePreference: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
139
|
+
indentStyle?: "tab" | "space" | undefined;
|
|
140
|
+
indentWidth?: number | undefined;
|
|
141
|
+
quoteStyle?: "single" | "double" | undefined;
|
|
142
|
+
semicolons?: "always" | "asNeeded" | undefined;
|
|
143
|
+
trailingCommas?: "all" | "es5" | "none" | undefined;
|
|
144
|
+
jsxQuoteStyle?: "single" | "double" | undefined;
|
|
110
145
|
};
|
|
111
146
|
declare function getFromContext(): void;
|
|
112
147
|
declare module "@typescript-eslint/utils/ts-eslint" {
|
|
113
|
-
|
|
114
|
-
}
|
|
148
|
+
interface SharedConfigurationSettings {}
|
|
115
149
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
declare
|
|
120
|
-
|
|
121
|
-
declare namespace index {
|
|
122
|
-
export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_defaultLanguagePreference as defaultLanguagePreference, index_getFromContext as getFromContext, make$1 as make };
|
|
150
|
+
declare namespace index_d_exports$1 {
|
|
151
|
+
export { LanguagePreference, LanguagePreferenceSchema, defaultLanguagePreference, getFromContext, make$1 as make };
|
|
152
|
+
}
|
|
153
|
+
declare namespace RegExp_d_exports {
|
|
154
|
+
export { ANNOTATION_JSX, ANNOTATION_JSX_FRAG, ANNOTATION_JSX_IMPORT_SOURCE, ANNOTATION_JSX_RUNTIME, CAMEL_CASE, COMPONENT_NAME, COMPONENT_NAME_LOOSE, CONSTANT_CASE, HOOK_NAME, HTML_TAG, JAVASCRIPT_PROTOCOL, JS_EXT, JS_IDENTIFIER, KEBAB_CASE, PASCAL_CASE, REGEXP_STR, SNAKE_CASE, TS_EXT, isRegExp, toRegExp };
|
|
123
155
|
}
|
|
124
|
-
|
|
125
156
|
/**
|
|
126
157
|
* Regular expressions for matching a HTML tag name
|
|
127
158
|
*/
|
|
@@ -200,7 +231,7 @@ declare const HOOK_NAME: RegExp;
|
|
|
200
231
|
* @returns Returns the `RegExp`.
|
|
201
232
|
*/
|
|
202
233
|
declare function toRegExp(string: string): {
|
|
203
|
-
|
|
234
|
+
test(s: string): boolean;
|
|
204
235
|
};
|
|
205
236
|
/**
|
|
206
237
|
* Checks whether given string is regexp string
|
|
@@ -208,82 +239,44 @@ declare function toRegExp(string: string): {
|
|
|
208
239
|
* @returns boolean
|
|
209
240
|
*/
|
|
210
241
|
declare function isRegExp(string: string): boolean;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
declare const RegExp$1_ANNOTATION_JSX_FRAG: typeof ANNOTATION_JSX_FRAG;
|
|
214
|
-
declare const RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE: typeof ANNOTATION_JSX_IMPORT_SOURCE;
|
|
215
|
-
declare const RegExp$1_ANNOTATION_JSX_RUNTIME: typeof ANNOTATION_JSX_RUNTIME;
|
|
216
|
-
declare const RegExp$1_CAMEL_CASE: typeof CAMEL_CASE;
|
|
217
|
-
declare const RegExp$1_COMPONENT_NAME: typeof COMPONENT_NAME;
|
|
218
|
-
declare const RegExp$1_COMPONENT_NAME_LOOSE: typeof COMPONENT_NAME_LOOSE;
|
|
219
|
-
declare const RegExp$1_CONSTANT_CASE: typeof CONSTANT_CASE;
|
|
220
|
-
declare const RegExp$1_HOOK_NAME: typeof HOOK_NAME;
|
|
221
|
-
declare const RegExp$1_HTML_TAG: typeof HTML_TAG;
|
|
222
|
-
declare const RegExp$1_JAVASCRIPT_PROTOCOL: typeof JAVASCRIPT_PROTOCOL;
|
|
223
|
-
declare const RegExp$1_JS_EXT: typeof JS_EXT;
|
|
224
|
-
declare const RegExp$1_JS_IDENTIFIER: typeof JS_IDENTIFIER;
|
|
225
|
-
declare const RegExp$1_KEBAB_CASE: typeof KEBAB_CASE;
|
|
226
|
-
declare const RegExp$1_PASCAL_CASE: typeof PASCAL_CASE;
|
|
227
|
-
declare const RegExp$1_REGEXP_STR: typeof REGEXP_STR;
|
|
228
|
-
declare const RegExp$1_SNAKE_CASE: typeof SNAKE_CASE;
|
|
229
|
-
declare const RegExp$1_TS_EXT: typeof TS_EXT;
|
|
230
|
-
declare const RegExp$1_isRegExp: typeof isRegExp;
|
|
231
|
-
declare const RegExp$1_toRegExp: typeof toRegExp;
|
|
232
|
-
declare namespace RegExp$1 {
|
|
233
|
-
export { RegExp$1_ANNOTATION_JSX as ANNOTATION_JSX, RegExp$1_ANNOTATION_JSX_FRAG as ANNOTATION_JSX_FRAG, RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE as ANNOTATION_JSX_IMPORT_SOURCE, RegExp$1_ANNOTATION_JSX_RUNTIME as ANNOTATION_JSX_RUNTIME, RegExp$1_CAMEL_CASE as CAMEL_CASE, RegExp$1_COMPONENT_NAME as COMPONENT_NAME, RegExp$1_COMPONENT_NAME_LOOSE as COMPONENT_NAME_LOOSE, RegExp$1_CONSTANT_CASE as CONSTANT_CASE, RegExp$1_HOOK_NAME as HOOK_NAME, RegExp$1_HTML_TAG as HTML_TAG, RegExp$1_JAVASCRIPT_PROTOCOL as JAVASCRIPT_PROTOCOL, RegExp$1_JS_EXT as JS_EXT, RegExp$1_JS_IDENTIFIER as JS_IDENTIFIER, RegExp$1_KEBAB_CASE as KEBAB_CASE, RegExp$1_PASCAL_CASE as PASCAL_CASE, RegExp$1_REGEXP_STR as REGEXP_STR, RegExp$1_SNAKE_CASE as SNAKE_CASE, RegExp$1_TS_EXT as TS_EXT, RegExp$1_isRegExp as isRegExp, RegExp$1_toRegExp as toRegExp };
|
|
242
|
+
declare namespace Reporter_d_exports {
|
|
243
|
+
export { Reporter, make, send, sendOrElse };
|
|
234
244
|
}
|
|
235
|
-
|
|
236
245
|
interface Reporter<TMessageID extends string> {
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
247
|
+
sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
|
|
239
248
|
}
|
|
240
249
|
declare const send: {
|
|
241
|
-
|
|
242
|
-
|
|
250
|
+
<TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
|
|
251
|
+
<TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
243
252
|
};
|
|
244
253
|
declare const sendOrElse: {
|
|
245
|
-
|
|
246
|
-
|
|
254
|
+
<TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
|
|
255
|
+
<TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
|
|
247
256
|
};
|
|
248
257
|
declare function make<TMessageID extends string>(context: RuleContext): Reporter<TMessageID>;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
declare const Reporter$1_make: typeof make;
|
|
252
|
-
declare const Reporter$1_send: typeof send;
|
|
253
|
-
declare const Reporter$1_sendOrElse: typeof sendOrElse;
|
|
254
|
-
declare namespace Reporter$1 {
|
|
255
|
-
export { type Reporter$1_Reporter as Reporter, Reporter$1_make as make, Reporter$1_send as send, Reporter$1_sendOrElse as sendOrElse };
|
|
258
|
+
declare namespace Selector_d_exports {
|
|
259
|
+
export { DISPLAY_NAME_ASSIGNMENT_EXPRESSION, DisplayNameAssignmentExpression, IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, ImplicitReturnArrowFunctionExpression, OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, ObjectDestructuringVariableDeclarator };
|
|
256
260
|
}
|
|
257
|
-
|
|
258
261
|
type ImplicitReturnArrowFunctionExpression = TSESTree.ArrowFunctionExpression & {
|
|
259
|
-
|
|
262
|
+
body: TSESTree.Expression;
|
|
260
263
|
};
|
|
261
264
|
type ObjectDestructuringVariableDeclarator = TSESTree.VariableDeclarator & {
|
|
262
|
-
|
|
263
|
-
|
|
265
|
+
id: TSESTree.ObjectPattern;
|
|
266
|
+
init: TSESTree.Identifier;
|
|
264
267
|
};
|
|
265
268
|
type DisplayNameAssignmentExpression = TSESTree.AssignmentExpression & {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
};
|
|
269
|
+
type: "AssignmentExpression";
|
|
270
|
+
left: TSESTree.MemberExpression & {
|
|
271
|
+
property: TSESTree.Identifier & {
|
|
272
|
+
name: "displayName";
|
|
271
273
|
};
|
|
272
|
-
|
|
273
|
-
|
|
274
|
+
};
|
|
275
|
+
operator: "=";
|
|
276
|
+
right: TSESTree.Literal;
|
|
274
277
|
};
|
|
275
278
|
declare const IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION = "ArrowFunctionExpression[body.type!='BlockStatement']";
|
|
276
279
|
declare const OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: string;
|
|
277
280
|
declare const DISPLAY_NAME_ASSIGNMENT_EXPRESSION: string;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
type Selector_DisplayNameAssignmentExpression = DisplayNameAssignmentExpression;
|
|
281
|
-
declare const Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION: typeof IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION;
|
|
282
|
-
type Selector_ImplicitReturnArrowFunctionExpression = ImplicitReturnArrowFunctionExpression;
|
|
283
|
-
declare const Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: typeof OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR;
|
|
284
|
-
type Selector_ObjectDestructuringVariableDeclarator = ObjectDestructuringVariableDeclarator;
|
|
285
|
-
declare namespace Selector {
|
|
286
|
-
export { Selector_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type Selector_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type Selector_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type Selector_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export { index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, Selector };
|
|
281
|
+
//#endregion
|
|
282
|
+
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, index_d_exports as JsxConfig, index_d_exports$1 as LanguagePreference, RegExp_d_exports as RegExp, Reporter_d_exports as Reporter, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, Selector_d_exports as Selector, SettingsConfig, Severity, SeverityLevel, SeverityName };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,36 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as tseslint from
|
|
3
|
-
import { ReportDescriptor } from
|
|
4
|
-
import { z } from
|
|
5
|
-
import { unit } from
|
|
6
|
-
import { TSESTree } from
|
|
1
|
+
import * as typescript0 from "typescript";
|
|
2
|
+
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
import { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
+
import { z } from "zod/v4";
|
|
5
|
+
import { unit } from "@eslint-react/eff";
|
|
6
|
+
import { TSESTree } from "@typescript-eslint/utils";
|
|
7
7
|
|
|
8
|
+
//#region rolldown:runtime
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/types.d.ts
|
|
8
11
|
/**
|
|
9
12
|
* Rule severity.
|
|
10
13
|
* @since 0.0.1
|
|
11
14
|
*/
|
|
12
|
-
type
|
|
15
|
+
type SeverityName = "off" | "warn" | "error";
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
+
* The numeric severity level for a rule.
|
|
18
|
+
*
|
|
19
|
+
* - `0` means off.
|
|
20
|
+
* - `1` means warn.
|
|
21
|
+
* - `2` means error.
|
|
17
22
|
*/
|
|
18
|
-
type
|
|
23
|
+
type SeverityLevel = 0 | 1 | 2;
|
|
19
24
|
/**
|
|
20
|
-
*
|
|
25
|
+
* The severity of a rule in a configuration.
|
|
26
|
+
*/
|
|
27
|
+
type Severity = SeverityName | SeverityLevel;
|
|
28
|
+
/**
|
|
29
|
+
* Rule declaration.
|
|
30
|
+
* @internal
|
|
21
31
|
* @since 0.0.1
|
|
22
32
|
*/
|
|
23
|
-
type
|
|
33
|
+
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
|
|
24
34
|
/**
|
|
25
35
|
* Rule context.
|
|
26
36
|
* @since 0.0.1
|
|
@@ -31,20 +41,49 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
31
41
|
* @since 1.20.0
|
|
32
42
|
*/
|
|
33
43
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
|
-
|
|
44
|
+
type RulePolicy = number;
|
|
45
|
+
type RuleSuggest<MessageIds extends string = string> = {
|
|
46
|
+
messageId: MessageIds;
|
|
47
|
+
data?: Record<string, unknown>;
|
|
48
|
+
fix: tseslint.ReportFixFunction;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* A collection of settings.
|
|
52
|
+
*/
|
|
53
|
+
interface SettingsConfig {
|
|
54
|
+
[key: string]: unknown;
|
|
55
|
+
}
|
|
56
|
+
interface CompatibleRule {
|
|
57
|
+
meta: Record<string, any>;
|
|
58
|
+
create: (...args: any[]) => any;
|
|
59
|
+
}
|
|
60
|
+
interface CompatiblePlugin {
|
|
61
|
+
meta: {
|
|
62
|
+
name: string;
|
|
63
|
+
version: string;
|
|
64
|
+
};
|
|
65
|
+
rules: Record<string, CompatibleRule>;
|
|
66
|
+
}
|
|
67
|
+
interface CompatibleConfig {
|
|
68
|
+
name?: string;
|
|
69
|
+
rules?: Record<string, RuleConfig>;
|
|
70
|
+
settings?: SettingsConfig;
|
|
71
|
+
}
|
|
72
|
+
//#endregion
|
|
73
|
+
//#region src/JsxConfig/JsxConfig.d.ts
|
|
35
74
|
declare const JsxEmit: {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
75
|
+
readonly None: 0;
|
|
76
|
+
readonly Preserve: 1;
|
|
77
|
+
readonly React: 2;
|
|
78
|
+
readonly ReactNative: 3;
|
|
79
|
+
readonly ReactJSX: 4;
|
|
80
|
+
readonly ReactJSXDev: 5;
|
|
42
81
|
};
|
|
43
82
|
interface JsxConfig {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
83
|
+
jsx?: number;
|
|
84
|
+
jsxFactory?: string;
|
|
85
|
+
jsxFragmentFactory?: string;
|
|
86
|
+
jsxImportSource?: string;
|
|
48
87
|
}
|
|
49
88
|
/**
|
|
50
89
|
* Create a JsxConfig object
|
|
@@ -57,11 +96,11 @@ declare function make$2(): JsxConfig;
|
|
|
57
96
|
* @returns JsxConfig
|
|
58
97
|
*/
|
|
59
98
|
declare function getFromContext$1(context: RuleContext): {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
99
|
+
jsx: 4 | typescript0.JsxEmit;
|
|
100
|
+
jsxFactory: string;
|
|
101
|
+
jsxFragmentFactory: string;
|
|
102
|
+
jsxImportSource: string;
|
|
103
|
+
reactNamespace: string;
|
|
65
104
|
};
|
|
66
105
|
/**
|
|
67
106
|
* Get JsxConfig from annotation
|
|
@@ -69,26 +108,24 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
69
108
|
* @returns JsxConfig
|
|
70
109
|
*/
|
|
71
110
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
75
|
-
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
76
|
-
declare namespace index$1 {
|
|
77
|
-
export { type index$1_JsxConfig as JsxConfig, index$1_JsxEmit as JsxEmit, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
111
|
+
declare namespace index_d_exports {
|
|
112
|
+
export { JsxConfig, JsxEmit, getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
78
113
|
}
|
|
79
|
-
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/LanguagePreference/LanguagePreferenceSchema.d.ts
|
|
80
116
|
/**
|
|
81
117
|
* @internal
|
|
82
118
|
*/
|
|
83
119
|
declare const LanguagePreferenceSchema: z.ZodObject<{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
120
|
+
indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
|
|
121
|
+
indentWidth: z.ZodOptional<z.ZodNumber>;
|
|
122
|
+
quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
123
|
+
semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
|
|
124
|
+
trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
|
|
125
|
+
jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
90
126
|
}, z.core.$strip>;
|
|
91
|
-
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/LanguagePreference/LanguagePreference.d.ts
|
|
92
129
|
/**
|
|
93
130
|
* @internal
|
|
94
131
|
*/
|
|
@@ -101,27 +138,23 @@ declare function make$1(): LanguagePreference;
|
|
|
101
138
|
* A default LanguagePreference object.
|
|
102
139
|
*/
|
|
103
140
|
declare const defaultLanguagePreference: {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
141
|
+
indentStyle?: "tab" | "space" | undefined;
|
|
142
|
+
indentWidth?: number | undefined;
|
|
143
|
+
quoteStyle?: "single" | "double" | undefined;
|
|
144
|
+
semicolons?: "always" | "asNeeded" | undefined;
|
|
145
|
+
trailingCommas?: "all" | "es5" | "none" | undefined;
|
|
146
|
+
jsxQuoteStyle?: "single" | "double" | undefined;
|
|
110
147
|
};
|
|
111
148
|
declare function getFromContext(): void;
|
|
112
149
|
declare module "@typescript-eslint/utils/ts-eslint" {
|
|
113
|
-
|
|
114
|
-
}
|
|
150
|
+
interface SharedConfigurationSettings {}
|
|
115
151
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
declare
|
|
120
|
-
|
|
121
|
-
declare namespace index {
|
|
122
|
-
export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_defaultLanguagePreference as defaultLanguagePreference, index_getFromContext as getFromContext, make$1 as make };
|
|
152
|
+
declare namespace index_d_exports$1 {
|
|
153
|
+
export { LanguagePreference, LanguagePreferenceSchema, defaultLanguagePreference, getFromContext, make$1 as make };
|
|
154
|
+
}
|
|
155
|
+
declare namespace RegExp_d_exports {
|
|
156
|
+
export { ANNOTATION_JSX, ANNOTATION_JSX_FRAG, ANNOTATION_JSX_IMPORT_SOURCE, ANNOTATION_JSX_RUNTIME, CAMEL_CASE, COMPONENT_NAME, COMPONENT_NAME_LOOSE, CONSTANT_CASE, HOOK_NAME, HTML_TAG, JAVASCRIPT_PROTOCOL, JS_EXT, JS_IDENTIFIER, KEBAB_CASE, PASCAL_CASE, REGEXP_STR, SNAKE_CASE, TS_EXT, isRegExp, toRegExp };
|
|
123
157
|
}
|
|
124
|
-
|
|
125
158
|
/**
|
|
126
159
|
* Regular expressions for matching a HTML tag name
|
|
127
160
|
*/
|
|
@@ -200,7 +233,7 @@ declare const HOOK_NAME: RegExp;
|
|
|
200
233
|
* @returns Returns the `RegExp`.
|
|
201
234
|
*/
|
|
202
235
|
declare function toRegExp(string: string): {
|
|
203
|
-
|
|
236
|
+
test(s: string): boolean;
|
|
204
237
|
};
|
|
205
238
|
/**
|
|
206
239
|
* Checks whether given string is regexp string
|
|
@@ -208,82 +241,44 @@ declare function toRegExp(string: string): {
|
|
|
208
241
|
* @returns boolean
|
|
209
242
|
*/
|
|
210
243
|
declare function isRegExp(string: string): boolean;
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
declare const RegExp$1_ANNOTATION_JSX_FRAG: typeof ANNOTATION_JSX_FRAG;
|
|
214
|
-
declare const RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE: typeof ANNOTATION_JSX_IMPORT_SOURCE;
|
|
215
|
-
declare const RegExp$1_ANNOTATION_JSX_RUNTIME: typeof ANNOTATION_JSX_RUNTIME;
|
|
216
|
-
declare const RegExp$1_CAMEL_CASE: typeof CAMEL_CASE;
|
|
217
|
-
declare const RegExp$1_COMPONENT_NAME: typeof COMPONENT_NAME;
|
|
218
|
-
declare const RegExp$1_COMPONENT_NAME_LOOSE: typeof COMPONENT_NAME_LOOSE;
|
|
219
|
-
declare const RegExp$1_CONSTANT_CASE: typeof CONSTANT_CASE;
|
|
220
|
-
declare const RegExp$1_HOOK_NAME: typeof HOOK_NAME;
|
|
221
|
-
declare const RegExp$1_HTML_TAG: typeof HTML_TAG;
|
|
222
|
-
declare const RegExp$1_JAVASCRIPT_PROTOCOL: typeof JAVASCRIPT_PROTOCOL;
|
|
223
|
-
declare const RegExp$1_JS_EXT: typeof JS_EXT;
|
|
224
|
-
declare const RegExp$1_JS_IDENTIFIER: typeof JS_IDENTIFIER;
|
|
225
|
-
declare const RegExp$1_KEBAB_CASE: typeof KEBAB_CASE;
|
|
226
|
-
declare const RegExp$1_PASCAL_CASE: typeof PASCAL_CASE;
|
|
227
|
-
declare const RegExp$1_REGEXP_STR: typeof REGEXP_STR;
|
|
228
|
-
declare const RegExp$1_SNAKE_CASE: typeof SNAKE_CASE;
|
|
229
|
-
declare const RegExp$1_TS_EXT: typeof TS_EXT;
|
|
230
|
-
declare const RegExp$1_isRegExp: typeof isRegExp;
|
|
231
|
-
declare const RegExp$1_toRegExp: typeof toRegExp;
|
|
232
|
-
declare namespace RegExp$1 {
|
|
233
|
-
export { RegExp$1_ANNOTATION_JSX as ANNOTATION_JSX, RegExp$1_ANNOTATION_JSX_FRAG as ANNOTATION_JSX_FRAG, RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE as ANNOTATION_JSX_IMPORT_SOURCE, RegExp$1_ANNOTATION_JSX_RUNTIME as ANNOTATION_JSX_RUNTIME, RegExp$1_CAMEL_CASE as CAMEL_CASE, RegExp$1_COMPONENT_NAME as COMPONENT_NAME, RegExp$1_COMPONENT_NAME_LOOSE as COMPONENT_NAME_LOOSE, RegExp$1_CONSTANT_CASE as CONSTANT_CASE, RegExp$1_HOOK_NAME as HOOK_NAME, RegExp$1_HTML_TAG as HTML_TAG, RegExp$1_JAVASCRIPT_PROTOCOL as JAVASCRIPT_PROTOCOL, RegExp$1_JS_EXT as JS_EXT, RegExp$1_JS_IDENTIFIER as JS_IDENTIFIER, RegExp$1_KEBAB_CASE as KEBAB_CASE, RegExp$1_PASCAL_CASE as PASCAL_CASE, RegExp$1_REGEXP_STR as REGEXP_STR, RegExp$1_SNAKE_CASE as SNAKE_CASE, RegExp$1_TS_EXT as TS_EXT, RegExp$1_isRegExp as isRegExp, RegExp$1_toRegExp as toRegExp };
|
|
244
|
+
declare namespace Reporter_d_exports {
|
|
245
|
+
export { Reporter, make, send, sendOrElse };
|
|
234
246
|
}
|
|
235
|
-
|
|
236
247
|
interface Reporter<TMessageID extends string> {
|
|
237
|
-
|
|
238
|
-
|
|
248
|
+
send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
249
|
+
sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
|
|
239
250
|
}
|
|
240
251
|
declare const send: {
|
|
241
|
-
|
|
242
|
-
|
|
252
|
+
<TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
|
|
253
|
+
<TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
243
254
|
};
|
|
244
255
|
declare const sendOrElse: {
|
|
245
|
-
|
|
246
|
-
|
|
256
|
+
<TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
|
|
257
|
+
<TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
|
|
247
258
|
};
|
|
248
259
|
declare function make<TMessageID extends string>(context: RuleContext): Reporter<TMessageID>;
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
declare const Reporter$1_make: typeof make;
|
|
252
|
-
declare const Reporter$1_send: typeof send;
|
|
253
|
-
declare const Reporter$1_sendOrElse: typeof sendOrElse;
|
|
254
|
-
declare namespace Reporter$1 {
|
|
255
|
-
export { type Reporter$1_Reporter as Reporter, Reporter$1_make as make, Reporter$1_send as send, Reporter$1_sendOrElse as sendOrElse };
|
|
260
|
+
declare namespace Selector_d_exports {
|
|
261
|
+
export { DISPLAY_NAME_ASSIGNMENT_EXPRESSION, DisplayNameAssignmentExpression, IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, ImplicitReturnArrowFunctionExpression, OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, ObjectDestructuringVariableDeclarator };
|
|
256
262
|
}
|
|
257
|
-
|
|
258
263
|
type ImplicitReturnArrowFunctionExpression = TSESTree.ArrowFunctionExpression & {
|
|
259
|
-
|
|
264
|
+
body: TSESTree.Expression;
|
|
260
265
|
};
|
|
261
266
|
type ObjectDestructuringVariableDeclarator = TSESTree.VariableDeclarator & {
|
|
262
|
-
|
|
263
|
-
|
|
267
|
+
id: TSESTree.ObjectPattern;
|
|
268
|
+
init: TSESTree.Identifier;
|
|
264
269
|
};
|
|
265
270
|
type DisplayNameAssignmentExpression = TSESTree.AssignmentExpression & {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
};
|
|
271
|
+
type: "AssignmentExpression";
|
|
272
|
+
left: TSESTree.MemberExpression & {
|
|
273
|
+
property: TSESTree.Identifier & {
|
|
274
|
+
name: "displayName";
|
|
271
275
|
};
|
|
272
|
-
|
|
273
|
-
|
|
276
|
+
};
|
|
277
|
+
operator: "=";
|
|
278
|
+
right: TSESTree.Literal;
|
|
274
279
|
};
|
|
275
280
|
declare const IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION = "ArrowFunctionExpression[body.type!='BlockStatement']";
|
|
276
281
|
declare const OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: string;
|
|
277
282
|
declare const DISPLAY_NAME_ASSIGNMENT_EXPRESSION: string;
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
type Selector_DisplayNameAssignmentExpression = DisplayNameAssignmentExpression;
|
|
281
|
-
declare const Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION: typeof IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION;
|
|
282
|
-
type Selector_ImplicitReturnArrowFunctionExpression = ImplicitReturnArrowFunctionExpression;
|
|
283
|
-
declare const Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: typeof OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR;
|
|
284
|
-
type Selector_ObjectDestructuringVariableDeclarator = ObjectDestructuringVariableDeclarator;
|
|
285
|
-
declare namespace Selector {
|
|
286
|
-
export { Selector_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type Selector_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type Selector_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type Selector_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
export { index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, Selector };
|
|
283
|
+
//#endregion
|
|
284
|
+
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, index_d_exports as JsxConfig, index_d_exports$1 as LanguagePreference, RegExp_d_exports as RegExp, Reporter_d_exports as Reporter, RuleConfig, RuleContext, RuleFeature, RulePolicy, RuleSuggest, Selector_d_exports as Selector, SettingsConfig, Severity, SeverityLevel, SeverityName };
|