@eslint-react/kit 2.0.0-next.58 → 2.0.0-next.61
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-51aI8Tpl.js +33 -0
- package/dist/index.d.ts +147 -126
- package/dist/index.js +605 -182
- package/package.json +8 -8
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
28
|
+
value: mod,
|
|
29
|
+
enumerable: true
|
|
30
|
+
}) : target, mod));
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { __commonJS, __export, __toESM };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,68 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
1
|
+
import { unit } from "@eslint-react/eff";
|
|
2
|
+
import { z } from "zod/v4";
|
|
3
|
+
import { TSESTree } from "@typescript-eslint/types";
|
|
4
|
+
import * as typescript0 from "typescript";
|
|
5
|
+
import * as tseslint from "@typescript-eslint/utils/ts-eslint";
|
|
6
|
+
import { ReportDescriptor } from "@typescript-eslint/utils/ts-eslint";
|
|
7
|
+
import { TSESTree as TSESTree$1 } from "@typescript-eslint/utils";
|
|
7
8
|
|
|
9
|
+
//#region src/ContextDetection.d.ts
|
|
10
|
+
declare namespace ContextDetection_d_exports {
|
|
11
|
+
export { isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isViMock, isViMockCallback };
|
|
12
|
+
}
|
|
8
13
|
/**
|
|
9
|
-
*
|
|
10
|
-
* @
|
|
14
|
+
* Check if the given node is a member expression that accesses `process.env.NODE_ENV`
|
|
15
|
+
* @param node The AST node
|
|
16
|
+
* @returns True if the node is a member expression that accesses `process.env.NODE_ENV`, false otherwise
|
|
11
17
|
*/
|
|
12
|
-
|
|
18
|
+
declare function isProcessEnvNodeEnv(node: TSESTree.Node | null | unit): node is TSESTree.MemberExpression;
|
|
13
19
|
/**
|
|
14
|
-
*
|
|
20
|
+
* Check if the given node is a binary expression that compares `process.env.NODE_ENV` with a string literal
|
|
21
|
+
* @param node The AST node
|
|
22
|
+
* @param operator The operator used in the comparison
|
|
23
|
+
* @param value The string literal value to compare against
|
|
24
|
+
* @returns True if the node is a binary expression that compares `process.env.NODE_ENV` with the specified value, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
declare function isProcessEnvNodeEnvCompare(node: TSESTree.Node | null | unit, operator: "===" | "!==", value: "development" | "production"): node is TSESTree.BinaryExpression;
|
|
27
|
+
/**
|
|
28
|
+
* Checks if the given node is a `vi.mock`.
|
|
29
|
+
* @param node The node to check
|
|
30
|
+
* @returns `true` if the node is a `vi.mock`, otherwise `false`.
|
|
15
31
|
* @internal
|
|
32
|
+
*/
|
|
33
|
+
declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.MemberExpression;
|
|
34
|
+
/**
|
|
35
|
+
* Checks if the given node is a `vi.mock` callback.
|
|
36
|
+
* @param node The node to check
|
|
37
|
+
* @returns `true` if the node is a `vi.mock` callback, otherwise `false`.
|
|
38
|
+
* @internal
|
|
39
|
+
*/
|
|
40
|
+
declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
|
|
41
|
+
//#endregion
|
|
42
|
+
//#region src/types.d.ts
|
|
43
|
+
/**
|
|
44
|
+
* Rule severity.
|
|
16
45
|
* @since 0.0.1
|
|
17
46
|
*/
|
|
18
|
-
type
|
|
47
|
+
type SeverityName = "off" | "warn" | "error";
|
|
19
48
|
/**
|
|
20
|
-
*
|
|
49
|
+
* The numeric severity level for a rule.
|
|
50
|
+
*
|
|
51
|
+
* - `0` means off.
|
|
52
|
+
* - `1` means warn.
|
|
53
|
+
* - `2` means error.
|
|
54
|
+
*/
|
|
55
|
+
type SeverityLevel = 0 | 1 | 2;
|
|
56
|
+
/**
|
|
57
|
+
* The severity of a rule in a configuration.
|
|
58
|
+
*/
|
|
59
|
+
type Severity = SeverityName | SeverityLevel;
|
|
60
|
+
/**
|
|
61
|
+
* Rule declaration.
|
|
62
|
+
* @internal
|
|
21
63
|
* @since 0.0.1
|
|
22
64
|
*/
|
|
23
|
-
type
|
|
65
|
+
type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
|
|
24
66
|
/**
|
|
25
67
|
* Rule context.
|
|
26
68
|
* @since 0.0.1
|
|
@@ -33,24 +75,47 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
33
75
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
76
|
type RulePolicy = number;
|
|
35
77
|
type RuleSuggest<MessageIds extends string = string> = {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
78
|
+
messageId: MessageIds;
|
|
79
|
+
data?: Record<string, unknown>;
|
|
80
|
+
fix: tseslint.ReportFixFunction;
|
|
39
81
|
};
|
|
40
|
-
|
|
82
|
+
/**
|
|
83
|
+
* A collection of settings.
|
|
84
|
+
*/
|
|
85
|
+
interface SettingsConfig {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
}
|
|
88
|
+
interface CompatibleRule {
|
|
89
|
+
meta: Record<string, any>;
|
|
90
|
+
create: (...args: any[]) => any;
|
|
91
|
+
}
|
|
92
|
+
interface CompatiblePlugin {
|
|
93
|
+
meta: {
|
|
94
|
+
name: string;
|
|
95
|
+
version: string;
|
|
96
|
+
};
|
|
97
|
+
rules: Record<string, CompatibleRule>;
|
|
98
|
+
}
|
|
99
|
+
interface CompatibleConfig {
|
|
100
|
+
name?: string;
|
|
101
|
+
rules?: Record<string, RuleConfig>;
|
|
102
|
+
settings?: SettingsConfig;
|
|
103
|
+
}
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/JsxConfig/JsxConfig.d.ts
|
|
41
106
|
declare const JsxEmit: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
107
|
+
readonly None: 0;
|
|
108
|
+
readonly Preserve: 1;
|
|
109
|
+
readonly React: 2;
|
|
110
|
+
readonly ReactNative: 3;
|
|
111
|
+
readonly ReactJSX: 4;
|
|
112
|
+
readonly ReactJSXDev: 5;
|
|
48
113
|
};
|
|
49
114
|
interface JsxConfig {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
115
|
+
jsx?: number;
|
|
116
|
+
jsxFactory?: string;
|
|
117
|
+
jsxFragmentFactory?: string;
|
|
118
|
+
jsxImportSource?: string;
|
|
54
119
|
}
|
|
55
120
|
/**
|
|
56
121
|
* Create a JsxConfig object
|
|
@@ -63,11 +128,11 @@ declare function make$2(): JsxConfig;
|
|
|
63
128
|
* @returns JsxConfig
|
|
64
129
|
*/
|
|
65
130
|
declare function getFromContext$1(context: RuleContext): {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
131
|
+
jsx: 4 | typescript0.JsxEmit;
|
|
132
|
+
jsxFactory: string;
|
|
133
|
+
jsxFragmentFactory: string;
|
|
134
|
+
jsxImportSource: string;
|
|
135
|
+
reactNamespace: string;
|
|
71
136
|
};
|
|
72
137
|
/**
|
|
73
138
|
* Get JsxConfig from annotation
|
|
@@ -75,26 +140,24 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
75
140
|
* @returns JsxConfig
|
|
76
141
|
*/
|
|
77
142
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
81
|
-
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
82
|
-
declare namespace index$1 {
|
|
83
|
-
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 };
|
|
143
|
+
declare namespace index_d_exports {
|
|
144
|
+
export { JsxConfig, JsxEmit, getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
84
145
|
}
|
|
85
|
-
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/LanguagePreference/LanguagePreferenceSchema.d.ts
|
|
86
148
|
/**
|
|
87
149
|
* @internal
|
|
88
150
|
*/
|
|
89
151
|
declare const LanguagePreferenceSchema: z.ZodObject<{
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
152
|
+
indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
|
|
153
|
+
indentWidth: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
155
|
+
semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
|
|
156
|
+
trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
|
|
157
|
+
jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
96
158
|
}, z.core.$strip>;
|
|
97
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/LanguagePreference/LanguagePreference.d.ts
|
|
98
161
|
/**
|
|
99
162
|
* @internal
|
|
100
163
|
*/
|
|
@@ -107,27 +170,23 @@ declare function make$1(): LanguagePreference;
|
|
|
107
170
|
* A default LanguagePreference object.
|
|
108
171
|
*/
|
|
109
172
|
declare const defaultLanguagePreference: {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
173
|
+
indentStyle?: "tab" | "space" | undefined;
|
|
174
|
+
indentWidth?: number | undefined;
|
|
175
|
+
quoteStyle?: "single" | "double" | undefined;
|
|
176
|
+
semicolons?: "always" | "asNeeded" | undefined;
|
|
177
|
+
trailingCommas?: "all" | "es5" | "none" | undefined;
|
|
178
|
+
jsxQuoteStyle?: "single" | "double" | undefined;
|
|
116
179
|
};
|
|
117
180
|
declare function getFromContext(): void;
|
|
118
181
|
declare module "@typescript-eslint/utils/ts-eslint" {
|
|
119
|
-
|
|
120
|
-
}
|
|
182
|
+
interface SharedConfigurationSettings {}
|
|
121
183
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
declare
|
|
126
|
-
|
|
127
|
-
declare namespace index {
|
|
128
|
-
export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_defaultLanguagePreference as defaultLanguagePreference, index_getFromContext as getFromContext, make$1 as make };
|
|
184
|
+
declare namespace index_d_exports$1 {
|
|
185
|
+
export { LanguagePreference, LanguagePreferenceSchema, defaultLanguagePreference, getFromContext, make$1 as make };
|
|
186
|
+
}
|
|
187
|
+
declare namespace RegExp_d_exports {
|
|
188
|
+
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 };
|
|
129
189
|
}
|
|
130
|
-
|
|
131
190
|
/**
|
|
132
191
|
* Regular expressions for matching a HTML tag name
|
|
133
192
|
*/
|
|
@@ -206,7 +265,7 @@ declare const HOOK_NAME: RegExp;
|
|
|
206
265
|
* @returns Returns the `RegExp`.
|
|
207
266
|
*/
|
|
208
267
|
declare function toRegExp(string: string): {
|
|
209
|
-
|
|
268
|
+
test(s: string): boolean;
|
|
210
269
|
};
|
|
211
270
|
/**
|
|
212
271
|
* Checks whether given string is regexp string
|
|
@@ -214,82 +273,44 @@ declare function toRegExp(string: string): {
|
|
|
214
273
|
* @returns boolean
|
|
215
274
|
*/
|
|
216
275
|
declare function isRegExp(string: string): boolean;
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
declare const RegExp$1_ANNOTATION_JSX_FRAG: typeof ANNOTATION_JSX_FRAG;
|
|
220
|
-
declare const RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE: typeof ANNOTATION_JSX_IMPORT_SOURCE;
|
|
221
|
-
declare const RegExp$1_ANNOTATION_JSX_RUNTIME: typeof ANNOTATION_JSX_RUNTIME;
|
|
222
|
-
declare const RegExp$1_CAMEL_CASE: typeof CAMEL_CASE;
|
|
223
|
-
declare const RegExp$1_COMPONENT_NAME: typeof COMPONENT_NAME;
|
|
224
|
-
declare const RegExp$1_COMPONENT_NAME_LOOSE: typeof COMPONENT_NAME_LOOSE;
|
|
225
|
-
declare const RegExp$1_CONSTANT_CASE: typeof CONSTANT_CASE;
|
|
226
|
-
declare const RegExp$1_HOOK_NAME: typeof HOOK_NAME;
|
|
227
|
-
declare const RegExp$1_HTML_TAG: typeof HTML_TAG;
|
|
228
|
-
declare const RegExp$1_JAVASCRIPT_PROTOCOL: typeof JAVASCRIPT_PROTOCOL;
|
|
229
|
-
declare const RegExp$1_JS_EXT: typeof JS_EXT;
|
|
230
|
-
declare const RegExp$1_JS_IDENTIFIER: typeof JS_IDENTIFIER;
|
|
231
|
-
declare const RegExp$1_KEBAB_CASE: typeof KEBAB_CASE;
|
|
232
|
-
declare const RegExp$1_PASCAL_CASE: typeof PASCAL_CASE;
|
|
233
|
-
declare const RegExp$1_REGEXP_STR: typeof REGEXP_STR;
|
|
234
|
-
declare const RegExp$1_SNAKE_CASE: typeof SNAKE_CASE;
|
|
235
|
-
declare const RegExp$1_TS_EXT: typeof TS_EXT;
|
|
236
|
-
declare const RegExp$1_isRegExp: typeof isRegExp;
|
|
237
|
-
declare const RegExp$1_toRegExp: typeof toRegExp;
|
|
238
|
-
declare namespace RegExp$1 {
|
|
239
|
-
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 };
|
|
276
|
+
declare namespace Reporter_d_exports {
|
|
277
|
+
export { Reporter, make, send, sendOrElse };
|
|
240
278
|
}
|
|
241
|
-
|
|
242
279
|
interface Reporter<TMessageID extends string> {
|
|
243
|
-
|
|
244
|
-
|
|
280
|
+
send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
281
|
+
sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
|
|
245
282
|
}
|
|
246
283
|
declare const send: {
|
|
247
|
-
|
|
248
|
-
|
|
284
|
+
<TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
|
|
285
|
+
<TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
249
286
|
};
|
|
250
287
|
declare const sendOrElse: {
|
|
251
|
-
|
|
252
|
-
|
|
288
|
+
<TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
|
|
289
|
+
<TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
|
|
253
290
|
};
|
|
254
291
|
declare function make<TMessageID extends string>(context: RuleContext): Reporter<TMessageID>;
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
declare const Reporter$1_make: typeof make;
|
|
258
|
-
declare const Reporter$1_send: typeof send;
|
|
259
|
-
declare const Reporter$1_sendOrElse: typeof sendOrElse;
|
|
260
|
-
declare namespace Reporter$1 {
|
|
261
|
-
export { type Reporter$1_Reporter as Reporter, Reporter$1_make as make, Reporter$1_send as send, Reporter$1_sendOrElse as sendOrElse };
|
|
292
|
+
declare namespace Selector_d_exports {
|
|
293
|
+
export { DISPLAY_NAME_ASSIGNMENT_EXPRESSION, DisplayNameAssignmentExpression, IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, ImplicitReturnArrowFunctionExpression, OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, ObjectDestructuringVariableDeclarator };
|
|
262
294
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
body: TSESTree.Expression;
|
|
295
|
+
type ImplicitReturnArrowFunctionExpression = TSESTree$1.ArrowFunctionExpression & {
|
|
296
|
+
body: TSESTree$1.Expression;
|
|
266
297
|
};
|
|
267
|
-
type ObjectDestructuringVariableDeclarator = TSESTree.VariableDeclarator & {
|
|
268
|
-
|
|
269
|
-
|
|
298
|
+
type ObjectDestructuringVariableDeclarator = TSESTree$1.VariableDeclarator & {
|
|
299
|
+
id: TSESTree$1.ObjectPattern;
|
|
300
|
+
init: TSESTree$1.Identifier;
|
|
270
301
|
};
|
|
271
|
-
type DisplayNameAssignmentExpression = TSESTree.AssignmentExpression & {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
};
|
|
302
|
+
type DisplayNameAssignmentExpression = TSESTree$1.AssignmentExpression & {
|
|
303
|
+
type: "AssignmentExpression";
|
|
304
|
+
left: TSESTree$1.MemberExpression & {
|
|
305
|
+
property: TSESTree$1.Identifier & {
|
|
306
|
+
name: "displayName";
|
|
277
307
|
};
|
|
278
|
-
|
|
279
|
-
|
|
308
|
+
};
|
|
309
|
+
operator: "=";
|
|
310
|
+
right: TSESTree$1.Literal;
|
|
280
311
|
};
|
|
281
312
|
declare const IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION = "ArrowFunctionExpression[body.type!='BlockStatement']";
|
|
282
313
|
declare const OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: string;
|
|
283
314
|
declare const DISPLAY_NAME_ASSIGNMENT_EXPRESSION: string;
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
type Selector_DisplayNameAssignmentExpression = DisplayNameAssignmentExpression;
|
|
287
|
-
declare const Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION: typeof IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION;
|
|
288
|
-
type Selector_ImplicitReturnArrowFunctionExpression = ImplicitReturnArrowFunctionExpression;
|
|
289
|
-
declare const Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: typeof OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR;
|
|
290
|
-
type Selector_ObjectDestructuringVariableDeclarator = ObjectDestructuringVariableDeclarator;
|
|
291
|
-
declare namespace Selector {
|
|
292
|
-
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 };
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
export { index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePolicy, type RulePreset, type RuleSeverity, type RuleSuggest, Selector };
|
|
315
|
+
//#endregion
|
|
316
|
+
export { CompatibleConfig, CompatiblePlugin, CompatibleRule, ContextDetection_d_exports as ContextDetection, 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.js
CHANGED
|
@@ -1,219 +1,642 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { __commonJS, __export, __toESM } from "./chunk-51aI8Tpl.js";
|
|
2
|
+
import * as AST from "@eslint-react/ast";
|
|
3
|
+
import { dual, getOrElseUpdate } from "@eslint-react/eff";
|
|
4
|
+
import { z } from "zod/v4";
|
|
3
5
|
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
//#region ../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js
|
|
7
|
+
var require_ast_spec = /* @__PURE__ */ __commonJS({ "../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/generated/ast-spec.js": ((exports) => {
|
|
8
|
+
/**********************************************
|
|
9
|
+
* DO NOT MODIFY THIS FILE MANUALLY *
|
|
10
|
+
* *
|
|
11
|
+
* THIS FILE HAS BEEN COPIED FROM ast-spec. *
|
|
12
|
+
* ANY CHANGES WILL BE LOST ON THE NEXT BUILD *
|
|
13
|
+
* *
|
|
14
|
+
* MAKE CHANGES TO ast-spec AND THEN RUN *
|
|
15
|
+
* yarn build *
|
|
16
|
+
**********************************************/
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
|
|
19
|
+
var AST_NODE_TYPES;
|
|
20
|
+
(function(AST_NODE_TYPES$1) {
|
|
21
|
+
AST_NODE_TYPES$1["AccessorProperty"] = "AccessorProperty";
|
|
22
|
+
AST_NODE_TYPES$1["ArrayExpression"] = "ArrayExpression";
|
|
23
|
+
AST_NODE_TYPES$1["ArrayPattern"] = "ArrayPattern";
|
|
24
|
+
AST_NODE_TYPES$1["ArrowFunctionExpression"] = "ArrowFunctionExpression";
|
|
25
|
+
AST_NODE_TYPES$1["AssignmentExpression"] = "AssignmentExpression";
|
|
26
|
+
AST_NODE_TYPES$1["AssignmentPattern"] = "AssignmentPattern";
|
|
27
|
+
AST_NODE_TYPES$1["AwaitExpression"] = "AwaitExpression";
|
|
28
|
+
AST_NODE_TYPES$1["BinaryExpression"] = "BinaryExpression";
|
|
29
|
+
AST_NODE_TYPES$1["BlockStatement"] = "BlockStatement";
|
|
30
|
+
AST_NODE_TYPES$1["BreakStatement"] = "BreakStatement";
|
|
31
|
+
AST_NODE_TYPES$1["CallExpression"] = "CallExpression";
|
|
32
|
+
AST_NODE_TYPES$1["CatchClause"] = "CatchClause";
|
|
33
|
+
AST_NODE_TYPES$1["ChainExpression"] = "ChainExpression";
|
|
34
|
+
AST_NODE_TYPES$1["ClassBody"] = "ClassBody";
|
|
35
|
+
AST_NODE_TYPES$1["ClassDeclaration"] = "ClassDeclaration";
|
|
36
|
+
AST_NODE_TYPES$1["ClassExpression"] = "ClassExpression";
|
|
37
|
+
AST_NODE_TYPES$1["ConditionalExpression"] = "ConditionalExpression";
|
|
38
|
+
AST_NODE_TYPES$1["ContinueStatement"] = "ContinueStatement";
|
|
39
|
+
AST_NODE_TYPES$1["DebuggerStatement"] = "DebuggerStatement";
|
|
40
|
+
AST_NODE_TYPES$1["Decorator"] = "Decorator";
|
|
41
|
+
AST_NODE_TYPES$1["DoWhileStatement"] = "DoWhileStatement";
|
|
42
|
+
AST_NODE_TYPES$1["EmptyStatement"] = "EmptyStatement";
|
|
43
|
+
AST_NODE_TYPES$1["ExportAllDeclaration"] = "ExportAllDeclaration";
|
|
44
|
+
AST_NODE_TYPES$1["ExportDefaultDeclaration"] = "ExportDefaultDeclaration";
|
|
45
|
+
AST_NODE_TYPES$1["ExportNamedDeclaration"] = "ExportNamedDeclaration";
|
|
46
|
+
AST_NODE_TYPES$1["ExportSpecifier"] = "ExportSpecifier";
|
|
47
|
+
AST_NODE_TYPES$1["ExpressionStatement"] = "ExpressionStatement";
|
|
48
|
+
AST_NODE_TYPES$1["ForInStatement"] = "ForInStatement";
|
|
49
|
+
AST_NODE_TYPES$1["ForOfStatement"] = "ForOfStatement";
|
|
50
|
+
AST_NODE_TYPES$1["ForStatement"] = "ForStatement";
|
|
51
|
+
AST_NODE_TYPES$1["FunctionDeclaration"] = "FunctionDeclaration";
|
|
52
|
+
AST_NODE_TYPES$1["FunctionExpression"] = "FunctionExpression";
|
|
53
|
+
AST_NODE_TYPES$1["Identifier"] = "Identifier";
|
|
54
|
+
AST_NODE_TYPES$1["IfStatement"] = "IfStatement";
|
|
55
|
+
AST_NODE_TYPES$1["ImportAttribute"] = "ImportAttribute";
|
|
56
|
+
AST_NODE_TYPES$1["ImportDeclaration"] = "ImportDeclaration";
|
|
57
|
+
AST_NODE_TYPES$1["ImportDefaultSpecifier"] = "ImportDefaultSpecifier";
|
|
58
|
+
AST_NODE_TYPES$1["ImportExpression"] = "ImportExpression";
|
|
59
|
+
AST_NODE_TYPES$1["ImportNamespaceSpecifier"] = "ImportNamespaceSpecifier";
|
|
60
|
+
AST_NODE_TYPES$1["ImportSpecifier"] = "ImportSpecifier";
|
|
61
|
+
AST_NODE_TYPES$1["JSXAttribute"] = "JSXAttribute";
|
|
62
|
+
AST_NODE_TYPES$1["JSXClosingElement"] = "JSXClosingElement";
|
|
63
|
+
AST_NODE_TYPES$1["JSXClosingFragment"] = "JSXClosingFragment";
|
|
64
|
+
AST_NODE_TYPES$1["JSXElement"] = "JSXElement";
|
|
65
|
+
AST_NODE_TYPES$1["JSXEmptyExpression"] = "JSXEmptyExpression";
|
|
66
|
+
AST_NODE_TYPES$1["JSXExpressionContainer"] = "JSXExpressionContainer";
|
|
67
|
+
AST_NODE_TYPES$1["JSXFragment"] = "JSXFragment";
|
|
68
|
+
AST_NODE_TYPES$1["JSXIdentifier"] = "JSXIdentifier";
|
|
69
|
+
AST_NODE_TYPES$1["JSXMemberExpression"] = "JSXMemberExpression";
|
|
70
|
+
AST_NODE_TYPES$1["JSXNamespacedName"] = "JSXNamespacedName";
|
|
71
|
+
AST_NODE_TYPES$1["JSXOpeningElement"] = "JSXOpeningElement";
|
|
72
|
+
AST_NODE_TYPES$1["JSXOpeningFragment"] = "JSXOpeningFragment";
|
|
73
|
+
AST_NODE_TYPES$1["JSXSpreadAttribute"] = "JSXSpreadAttribute";
|
|
74
|
+
AST_NODE_TYPES$1["JSXSpreadChild"] = "JSXSpreadChild";
|
|
75
|
+
AST_NODE_TYPES$1["JSXText"] = "JSXText";
|
|
76
|
+
AST_NODE_TYPES$1["LabeledStatement"] = "LabeledStatement";
|
|
77
|
+
AST_NODE_TYPES$1["Literal"] = "Literal";
|
|
78
|
+
AST_NODE_TYPES$1["LogicalExpression"] = "LogicalExpression";
|
|
79
|
+
AST_NODE_TYPES$1["MemberExpression"] = "MemberExpression";
|
|
80
|
+
AST_NODE_TYPES$1["MetaProperty"] = "MetaProperty";
|
|
81
|
+
AST_NODE_TYPES$1["MethodDefinition"] = "MethodDefinition";
|
|
82
|
+
AST_NODE_TYPES$1["NewExpression"] = "NewExpression";
|
|
83
|
+
AST_NODE_TYPES$1["ObjectExpression"] = "ObjectExpression";
|
|
84
|
+
AST_NODE_TYPES$1["ObjectPattern"] = "ObjectPattern";
|
|
85
|
+
AST_NODE_TYPES$1["PrivateIdentifier"] = "PrivateIdentifier";
|
|
86
|
+
AST_NODE_TYPES$1["Program"] = "Program";
|
|
87
|
+
AST_NODE_TYPES$1["Property"] = "Property";
|
|
88
|
+
AST_NODE_TYPES$1["PropertyDefinition"] = "PropertyDefinition";
|
|
89
|
+
AST_NODE_TYPES$1["RestElement"] = "RestElement";
|
|
90
|
+
AST_NODE_TYPES$1["ReturnStatement"] = "ReturnStatement";
|
|
91
|
+
AST_NODE_TYPES$1["SequenceExpression"] = "SequenceExpression";
|
|
92
|
+
AST_NODE_TYPES$1["SpreadElement"] = "SpreadElement";
|
|
93
|
+
AST_NODE_TYPES$1["StaticBlock"] = "StaticBlock";
|
|
94
|
+
AST_NODE_TYPES$1["Super"] = "Super";
|
|
95
|
+
AST_NODE_TYPES$1["SwitchCase"] = "SwitchCase";
|
|
96
|
+
AST_NODE_TYPES$1["SwitchStatement"] = "SwitchStatement";
|
|
97
|
+
AST_NODE_TYPES$1["TaggedTemplateExpression"] = "TaggedTemplateExpression";
|
|
98
|
+
AST_NODE_TYPES$1["TemplateElement"] = "TemplateElement";
|
|
99
|
+
AST_NODE_TYPES$1["TemplateLiteral"] = "TemplateLiteral";
|
|
100
|
+
AST_NODE_TYPES$1["ThisExpression"] = "ThisExpression";
|
|
101
|
+
AST_NODE_TYPES$1["ThrowStatement"] = "ThrowStatement";
|
|
102
|
+
AST_NODE_TYPES$1["TryStatement"] = "TryStatement";
|
|
103
|
+
AST_NODE_TYPES$1["UnaryExpression"] = "UnaryExpression";
|
|
104
|
+
AST_NODE_TYPES$1["UpdateExpression"] = "UpdateExpression";
|
|
105
|
+
AST_NODE_TYPES$1["VariableDeclaration"] = "VariableDeclaration";
|
|
106
|
+
AST_NODE_TYPES$1["VariableDeclarator"] = "VariableDeclarator";
|
|
107
|
+
AST_NODE_TYPES$1["WhileStatement"] = "WhileStatement";
|
|
108
|
+
AST_NODE_TYPES$1["WithStatement"] = "WithStatement";
|
|
109
|
+
AST_NODE_TYPES$1["YieldExpression"] = "YieldExpression";
|
|
110
|
+
AST_NODE_TYPES$1["TSAbstractAccessorProperty"] = "TSAbstractAccessorProperty";
|
|
111
|
+
AST_NODE_TYPES$1["TSAbstractKeyword"] = "TSAbstractKeyword";
|
|
112
|
+
AST_NODE_TYPES$1["TSAbstractMethodDefinition"] = "TSAbstractMethodDefinition";
|
|
113
|
+
AST_NODE_TYPES$1["TSAbstractPropertyDefinition"] = "TSAbstractPropertyDefinition";
|
|
114
|
+
AST_NODE_TYPES$1["TSAnyKeyword"] = "TSAnyKeyword";
|
|
115
|
+
AST_NODE_TYPES$1["TSArrayType"] = "TSArrayType";
|
|
116
|
+
AST_NODE_TYPES$1["TSAsExpression"] = "TSAsExpression";
|
|
117
|
+
AST_NODE_TYPES$1["TSAsyncKeyword"] = "TSAsyncKeyword";
|
|
118
|
+
AST_NODE_TYPES$1["TSBigIntKeyword"] = "TSBigIntKeyword";
|
|
119
|
+
AST_NODE_TYPES$1["TSBooleanKeyword"] = "TSBooleanKeyword";
|
|
120
|
+
AST_NODE_TYPES$1["TSCallSignatureDeclaration"] = "TSCallSignatureDeclaration";
|
|
121
|
+
AST_NODE_TYPES$1["TSClassImplements"] = "TSClassImplements";
|
|
122
|
+
AST_NODE_TYPES$1["TSConditionalType"] = "TSConditionalType";
|
|
123
|
+
AST_NODE_TYPES$1["TSConstructorType"] = "TSConstructorType";
|
|
124
|
+
AST_NODE_TYPES$1["TSConstructSignatureDeclaration"] = "TSConstructSignatureDeclaration";
|
|
125
|
+
AST_NODE_TYPES$1["TSDeclareFunction"] = "TSDeclareFunction";
|
|
126
|
+
AST_NODE_TYPES$1["TSDeclareKeyword"] = "TSDeclareKeyword";
|
|
127
|
+
AST_NODE_TYPES$1["TSEmptyBodyFunctionExpression"] = "TSEmptyBodyFunctionExpression";
|
|
128
|
+
AST_NODE_TYPES$1["TSEnumBody"] = "TSEnumBody";
|
|
129
|
+
AST_NODE_TYPES$1["TSEnumDeclaration"] = "TSEnumDeclaration";
|
|
130
|
+
AST_NODE_TYPES$1["TSEnumMember"] = "TSEnumMember";
|
|
131
|
+
AST_NODE_TYPES$1["TSExportAssignment"] = "TSExportAssignment";
|
|
132
|
+
AST_NODE_TYPES$1["TSExportKeyword"] = "TSExportKeyword";
|
|
133
|
+
AST_NODE_TYPES$1["TSExternalModuleReference"] = "TSExternalModuleReference";
|
|
134
|
+
AST_NODE_TYPES$1["TSFunctionType"] = "TSFunctionType";
|
|
135
|
+
AST_NODE_TYPES$1["TSImportEqualsDeclaration"] = "TSImportEqualsDeclaration";
|
|
136
|
+
AST_NODE_TYPES$1["TSImportType"] = "TSImportType";
|
|
137
|
+
AST_NODE_TYPES$1["TSIndexedAccessType"] = "TSIndexedAccessType";
|
|
138
|
+
AST_NODE_TYPES$1["TSIndexSignature"] = "TSIndexSignature";
|
|
139
|
+
AST_NODE_TYPES$1["TSInferType"] = "TSInferType";
|
|
140
|
+
AST_NODE_TYPES$1["TSInstantiationExpression"] = "TSInstantiationExpression";
|
|
141
|
+
AST_NODE_TYPES$1["TSInterfaceBody"] = "TSInterfaceBody";
|
|
142
|
+
AST_NODE_TYPES$1["TSInterfaceDeclaration"] = "TSInterfaceDeclaration";
|
|
143
|
+
AST_NODE_TYPES$1["TSInterfaceHeritage"] = "TSInterfaceHeritage";
|
|
144
|
+
AST_NODE_TYPES$1["TSIntersectionType"] = "TSIntersectionType";
|
|
145
|
+
AST_NODE_TYPES$1["TSIntrinsicKeyword"] = "TSIntrinsicKeyword";
|
|
146
|
+
AST_NODE_TYPES$1["TSLiteralType"] = "TSLiteralType";
|
|
147
|
+
AST_NODE_TYPES$1["TSMappedType"] = "TSMappedType";
|
|
148
|
+
AST_NODE_TYPES$1["TSMethodSignature"] = "TSMethodSignature";
|
|
149
|
+
AST_NODE_TYPES$1["TSModuleBlock"] = "TSModuleBlock";
|
|
150
|
+
AST_NODE_TYPES$1["TSModuleDeclaration"] = "TSModuleDeclaration";
|
|
151
|
+
AST_NODE_TYPES$1["TSNamedTupleMember"] = "TSNamedTupleMember";
|
|
152
|
+
AST_NODE_TYPES$1["TSNamespaceExportDeclaration"] = "TSNamespaceExportDeclaration";
|
|
153
|
+
AST_NODE_TYPES$1["TSNeverKeyword"] = "TSNeverKeyword";
|
|
154
|
+
AST_NODE_TYPES$1["TSNonNullExpression"] = "TSNonNullExpression";
|
|
155
|
+
AST_NODE_TYPES$1["TSNullKeyword"] = "TSNullKeyword";
|
|
156
|
+
AST_NODE_TYPES$1["TSNumberKeyword"] = "TSNumberKeyword";
|
|
157
|
+
AST_NODE_TYPES$1["TSObjectKeyword"] = "TSObjectKeyword";
|
|
158
|
+
AST_NODE_TYPES$1["TSOptionalType"] = "TSOptionalType";
|
|
159
|
+
AST_NODE_TYPES$1["TSParameterProperty"] = "TSParameterProperty";
|
|
160
|
+
AST_NODE_TYPES$1["TSPrivateKeyword"] = "TSPrivateKeyword";
|
|
161
|
+
AST_NODE_TYPES$1["TSPropertySignature"] = "TSPropertySignature";
|
|
162
|
+
AST_NODE_TYPES$1["TSProtectedKeyword"] = "TSProtectedKeyword";
|
|
163
|
+
AST_NODE_TYPES$1["TSPublicKeyword"] = "TSPublicKeyword";
|
|
164
|
+
AST_NODE_TYPES$1["TSQualifiedName"] = "TSQualifiedName";
|
|
165
|
+
AST_NODE_TYPES$1["TSReadonlyKeyword"] = "TSReadonlyKeyword";
|
|
166
|
+
AST_NODE_TYPES$1["TSRestType"] = "TSRestType";
|
|
167
|
+
AST_NODE_TYPES$1["TSSatisfiesExpression"] = "TSSatisfiesExpression";
|
|
168
|
+
AST_NODE_TYPES$1["TSStaticKeyword"] = "TSStaticKeyword";
|
|
169
|
+
AST_NODE_TYPES$1["TSStringKeyword"] = "TSStringKeyword";
|
|
170
|
+
AST_NODE_TYPES$1["TSSymbolKeyword"] = "TSSymbolKeyword";
|
|
171
|
+
AST_NODE_TYPES$1["TSTemplateLiteralType"] = "TSTemplateLiteralType";
|
|
172
|
+
AST_NODE_TYPES$1["TSThisType"] = "TSThisType";
|
|
173
|
+
AST_NODE_TYPES$1["TSTupleType"] = "TSTupleType";
|
|
174
|
+
AST_NODE_TYPES$1["TSTypeAliasDeclaration"] = "TSTypeAliasDeclaration";
|
|
175
|
+
AST_NODE_TYPES$1["TSTypeAnnotation"] = "TSTypeAnnotation";
|
|
176
|
+
AST_NODE_TYPES$1["TSTypeAssertion"] = "TSTypeAssertion";
|
|
177
|
+
AST_NODE_TYPES$1["TSTypeLiteral"] = "TSTypeLiteral";
|
|
178
|
+
AST_NODE_TYPES$1["TSTypeOperator"] = "TSTypeOperator";
|
|
179
|
+
AST_NODE_TYPES$1["TSTypeParameter"] = "TSTypeParameter";
|
|
180
|
+
AST_NODE_TYPES$1["TSTypeParameterDeclaration"] = "TSTypeParameterDeclaration";
|
|
181
|
+
AST_NODE_TYPES$1["TSTypeParameterInstantiation"] = "TSTypeParameterInstantiation";
|
|
182
|
+
AST_NODE_TYPES$1["TSTypePredicate"] = "TSTypePredicate";
|
|
183
|
+
AST_NODE_TYPES$1["TSTypeQuery"] = "TSTypeQuery";
|
|
184
|
+
AST_NODE_TYPES$1["TSTypeReference"] = "TSTypeReference";
|
|
185
|
+
AST_NODE_TYPES$1["TSUndefinedKeyword"] = "TSUndefinedKeyword";
|
|
186
|
+
AST_NODE_TYPES$1["TSUnionType"] = "TSUnionType";
|
|
187
|
+
AST_NODE_TYPES$1["TSUnknownKeyword"] = "TSUnknownKeyword";
|
|
188
|
+
AST_NODE_TYPES$1["TSVoidKeyword"] = "TSVoidKeyword";
|
|
189
|
+
})(AST_NODE_TYPES || (exports.AST_NODE_TYPES = AST_NODE_TYPES = {}));
|
|
190
|
+
var AST_TOKEN_TYPES;
|
|
191
|
+
(function(AST_TOKEN_TYPES$1) {
|
|
192
|
+
AST_TOKEN_TYPES$1["Boolean"] = "Boolean";
|
|
193
|
+
AST_TOKEN_TYPES$1["Identifier"] = "Identifier";
|
|
194
|
+
AST_TOKEN_TYPES$1["JSXIdentifier"] = "JSXIdentifier";
|
|
195
|
+
AST_TOKEN_TYPES$1["PrivateIdentifier"] = "PrivateIdentifier";
|
|
196
|
+
AST_TOKEN_TYPES$1["JSXText"] = "JSXText";
|
|
197
|
+
AST_TOKEN_TYPES$1["Keyword"] = "Keyword";
|
|
198
|
+
AST_TOKEN_TYPES$1["Null"] = "Null";
|
|
199
|
+
AST_TOKEN_TYPES$1["Numeric"] = "Numeric";
|
|
200
|
+
AST_TOKEN_TYPES$1["Punctuator"] = "Punctuator";
|
|
201
|
+
AST_TOKEN_TYPES$1["RegularExpression"] = "RegularExpression";
|
|
202
|
+
AST_TOKEN_TYPES$1["String"] = "String";
|
|
203
|
+
AST_TOKEN_TYPES$1["Template"] = "Template";
|
|
204
|
+
AST_TOKEN_TYPES$1["Block"] = "Block";
|
|
205
|
+
AST_TOKEN_TYPES$1["Line"] = "Line";
|
|
206
|
+
})(AST_TOKEN_TYPES || (exports.AST_TOKEN_TYPES = AST_TOKEN_TYPES = {}));
|
|
207
|
+
}) });
|
|
9
208
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region ../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/lib.js
|
|
211
|
+
var require_lib = /* @__PURE__ */ __commonJS({ "../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/lib.js": ((exports) => {
|
|
212
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
213
|
+
}) });
|
|
214
|
+
|
|
215
|
+
//#endregion
|
|
216
|
+
//#region ../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/parser-options.js
|
|
217
|
+
var require_parser_options = /* @__PURE__ */ __commonJS({ "../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/parser-options.js": ((exports) => {
|
|
218
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
219
|
+
}) });
|
|
220
|
+
|
|
221
|
+
//#endregion
|
|
222
|
+
//#region ../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/ts-estree.js
|
|
223
|
+
var require_ts_estree = /* @__PURE__ */ __commonJS({ "../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/ts-estree.js": ((exports) => {
|
|
224
|
+
var __createBinding$1 = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
225
|
+
if (k2 === void 0) k2 = k;
|
|
226
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
227
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
228
|
+
enumerable: true,
|
|
229
|
+
get: function() {
|
|
230
|
+
return m[k];
|
|
231
|
+
}
|
|
232
|
+
};
|
|
233
|
+
Object.defineProperty(o, k2, desc);
|
|
234
|
+
}) : (function(o, m, k, k2) {
|
|
235
|
+
if (k2 === void 0) k2 = k;
|
|
236
|
+
o[k2] = m[k];
|
|
237
|
+
}));
|
|
238
|
+
var __setModuleDefault = exports && exports.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
239
|
+
Object.defineProperty(o, "default", {
|
|
240
|
+
enumerable: true,
|
|
241
|
+
value: v
|
|
242
|
+
});
|
|
243
|
+
}) : function(o, v) {
|
|
244
|
+
o["default"] = v;
|
|
245
|
+
});
|
|
246
|
+
var __importStar = exports && exports.__importStar || (function() {
|
|
247
|
+
var ownKeys = function(o) {
|
|
248
|
+
ownKeys = Object.getOwnPropertyNames || function(o$1) {
|
|
249
|
+
var ar = [];
|
|
250
|
+
for (var k in o$1) if (Object.prototype.hasOwnProperty.call(o$1, k)) ar[ar.length] = k;
|
|
251
|
+
return ar;
|
|
252
|
+
};
|
|
253
|
+
return ownKeys(o);
|
|
254
|
+
};
|
|
255
|
+
return function(mod) {
|
|
256
|
+
if (mod && mod.__esModule) return mod;
|
|
257
|
+
var result = {};
|
|
258
|
+
if (mod != null) {
|
|
259
|
+
for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding$1(result, mod, k[i]);
|
|
260
|
+
}
|
|
261
|
+
__setModuleDefault(result, mod);
|
|
262
|
+
return result;
|
|
263
|
+
};
|
|
264
|
+
})();
|
|
265
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
266
|
+
exports.TSESTree = void 0;
|
|
267
|
+
exports.TSESTree = __importStar(require_ast_spec());
|
|
268
|
+
}) });
|
|
269
|
+
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region ../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/index.js
|
|
272
|
+
var require_dist = /* @__PURE__ */ __commonJS({ "../../../node_modules/.pnpm/@typescript-eslint+types@8.41.0/node_modules/@typescript-eslint/types/dist/index.js": ((exports) => {
|
|
273
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
274
|
+
if (k2 === void 0) k2 = k;
|
|
275
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
276
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function() {
|
|
279
|
+
return m[k];
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
Object.defineProperty(o, k2, desc);
|
|
283
|
+
}) : (function(o, m, k, k2) {
|
|
284
|
+
if (k2 === void 0) k2 = k;
|
|
285
|
+
o[k2] = m[k];
|
|
286
|
+
}));
|
|
287
|
+
var __exportStar = exports && exports.__exportStar || function(m, exports$1) {
|
|
288
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports$1, p)) __createBinding(exports$1, m, p);
|
|
289
|
+
};
|
|
290
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
291
|
+
exports.AST_TOKEN_TYPES = exports.AST_NODE_TYPES = void 0;
|
|
292
|
+
var ast_spec_1 = require_ast_spec();
|
|
293
|
+
Object.defineProperty(exports, "AST_NODE_TYPES", {
|
|
294
|
+
enumerable: true,
|
|
295
|
+
get: function() {
|
|
296
|
+
return ast_spec_1.AST_NODE_TYPES;
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
Object.defineProperty(exports, "AST_TOKEN_TYPES", {
|
|
300
|
+
enumerable: true,
|
|
301
|
+
get: function() {
|
|
302
|
+
return ast_spec_1.AST_TOKEN_TYPES;
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
__exportStar(require_lib(), exports);
|
|
306
|
+
__exportStar(require_parser_options(), exports);
|
|
307
|
+
__exportStar(require_ts_estree(), exports);
|
|
308
|
+
}) });
|
|
309
|
+
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region src/ContextDetection.ts
|
|
312
|
+
var ContextDetection_exports = {};
|
|
313
|
+
__export(ContextDetection_exports, {
|
|
314
|
+
isProcessEnvNodeEnv: () => isProcessEnvNodeEnv,
|
|
315
|
+
isProcessEnvNodeEnvCompare: () => isProcessEnvNodeEnvCompare,
|
|
316
|
+
isViMock: () => isViMock,
|
|
317
|
+
isViMockCallback: () => isViMockCallback
|
|
17
318
|
});
|
|
319
|
+
var import_dist = /* @__PURE__ */ __toESM(require_dist(), 1);
|
|
320
|
+
/**
|
|
321
|
+
* Check if the given node is a member expression that accesses `process.env.NODE_ENV`
|
|
322
|
+
* @param node The AST node
|
|
323
|
+
* @returns True if the node is a member expression that accesses `process.env.NODE_ENV`, false otherwise
|
|
324
|
+
*/
|
|
325
|
+
function isProcessEnvNodeEnv(node) {
|
|
326
|
+
return node != null && node.type === import_dist.AST_NODE_TYPES.MemberExpression && node.object.type === import_dist.AST_NODE_TYPES.MemberExpression && node.object.object.type === import_dist.AST_NODE_TYPES.Identifier && node.object.object.name === "process" && node.object.property.type === import_dist.AST_NODE_TYPES.Identifier && node.object.property.name === "env" && node.property.type === import_dist.AST_NODE_TYPES.Identifier && node.property.name === "NODE_ENV";
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Check if the given node is a binary expression that compares `process.env.NODE_ENV` with a string literal
|
|
330
|
+
* @param node The AST node
|
|
331
|
+
* @param operator The operator used in the comparison
|
|
332
|
+
* @param value The string literal value to compare against
|
|
333
|
+
* @returns True if the node is a binary expression that compares `process.env.NODE_ENV` with the specified value, false otherwise
|
|
334
|
+
*/
|
|
335
|
+
function isProcessEnvNodeEnvCompare(node, operator, value) {
|
|
336
|
+
if (node == null) return false;
|
|
337
|
+
if (node.type !== import_dist.AST_NODE_TYPES.BinaryExpression) return false;
|
|
338
|
+
if (node.operator !== operator) return false;
|
|
339
|
+
if (isProcessEnvNodeEnv(node.left) && AST.isLiteral(node.right, "string")) return node.right.value === value;
|
|
340
|
+
if (AST.isLiteral(node.left, "string") && isProcessEnvNodeEnv(node.right)) return node.left.value === value;
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Checks if the given node is a `vi.mock`.
|
|
345
|
+
* @param node The node to check
|
|
346
|
+
* @returns `true` if the node is a `vi.mock`, otherwise `false`.
|
|
347
|
+
* @internal
|
|
348
|
+
*/
|
|
349
|
+
function isViMock(node) {
|
|
350
|
+
return node != null && node.type === import_dist.AST_NODE_TYPES.MemberExpression && node.object.type === import_dist.AST_NODE_TYPES.Identifier && node.object.name === "vi" && node.property.type === import_dist.AST_NODE_TYPES.Identifier && node.property.name === "mock";
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Checks if the given node is a `vi.mock` callback.
|
|
354
|
+
* @param node The node to check
|
|
355
|
+
* @returns `true` if the node is a `vi.mock` callback, otherwise `false`.
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
358
|
+
function isViMockCallback(node) {
|
|
359
|
+
return node != null && AST.isFunction(node) && node.parent.type === import_dist.AST_NODE_TYPES.CallExpression && isViMock(node.parent.callee) && node.parent.arguments[1] === node;
|
|
360
|
+
}
|
|
18
361
|
|
|
19
|
-
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region src/RegExp.ts
|
|
20
364
|
var RegExp_exports = {};
|
|
21
365
|
__export(RegExp_exports, {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
366
|
+
ANNOTATION_JSX: () => ANNOTATION_JSX,
|
|
367
|
+
ANNOTATION_JSX_FRAG: () => ANNOTATION_JSX_FRAG,
|
|
368
|
+
ANNOTATION_JSX_IMPORT_SOURCE: () => ANNOTATION_JSX_IMPORT_SOURCE,
|
|
369
|
+
ANNOTATION_JSX_RUNTIME: () => ANNOTATION_JSX_RUNTIME,
|
|
370
|
+
CAMEL_CASE: () => CAMEL_CASE,
|
|
371
|
+
COMPONENT_NAME: () => COMPONENT_NAME,
|
|
372
|
+
COMPONENT_NAME_LOOSE: () => COMPONENT_NAME_LOOSE,
|
|
373
|
+
CONSTANT_CASE: () => CONSTANT_CASE,
|
|
374
|
+
HOOK_NAME: () => HOOK_NAME,
|
|
375
|
+
HTML_TAG: () => HTML_TAG,
|
|
376
|
+
JAVASCRIPT_PROTOCOL: () => JAVASCRIPT_PROTOCOL,
|
|
377
|
+
JS_EXT: () => JS_EXT,
|
|
378
|
+
JS_IDENTIFIER: () => JS_IDENTIFIER,
|
|
379
|
+
KEBAB_CASE: () => KEBAB_CASE,
|
|
380
|
+
PASCAL_CASE: () => PASCAL_CASE,
|
|
381
|
+
REGEXP_STR: () => REGEXP_STR,
|
|
382
|
+
SNAKE_CASE: () => SNAKE_CASE,
|
|
383
|
+
TS_EXT: () => TS_EXT,
|
|
384
|
+
isRegExp: () => isRegExp,
|
|
385
|
+
toRegExp: () => toRegExp
|
|
42
386
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
387
|
+
/**
|
|
388
|
+
* Regular expressions for matching a HTML tag name
|
|
389
|
+
*/
|
|
390
|
+
const HTML_TAG = /^[a-z][^-]*$/u;
|
|
391
|
+
/**
|
|
392
|
+
* Regular expression for matching a TypeScript file extension.
|
|
393
|
+
*/
|
|
394
|
+
const TS_EXT = /^[cm]?tsx?$/u;
|
|
395
|
+
/**
|
|
396
|
+
* Regular expression for matching a JavaScript file extension.
|
|
397
|
+
*/
|
|
398
|
+
const JS_EXT = /^[cm]?jsx?$/u;
|
|
399
|
+
/**
|
|
400
|
+
* Regular expression for matching a PascalCase string.
|
|
401
|
+
*/
|
|
402
|
+
const PASCAL_CASE = /^[A-Z][\dA-Za-z]*$/u;
|
|
403
|
+
/**
|
|
404
|
+
* Regular expression for matching a camelCase string.
|
|
405
|
+
*/
|
|
406
|
+
const CAMEL_CASE = /^[a-z][\dA-Za-z]*$/u;
|
|
407
|
+
/**
|
|
408
|
+
* Regular expression for matching a kebab-case string.
|
|
409
|
+
*/
|
|
410
|
+
const KEBAB_CASE = /^[a-z][\d\-a-z]*$/u;
|
|
411
|
+
/**
|
|
412
|
+
* Regular expression for matching a snake_case string.
|
|
413
|
+
*/
|
|
414
|
+
const SNAKE_CASE = /^[a-z][\d_a-z]*$/u;
|
|
415
|
+
/**
|
|
416
|
+
* Regular expression for matching a CONSTANT_CASE string.
|
|
417
|
+
*/
|
|
418
|
+
const CONSTANT_CASE = /^[A-Z][\d_A-Z]*$/u;
|
|
419
|
+
const JAVASCRIPT_PROTOCOL = /^[\u0000-\u001F ]*j[\t\n\r]*a[\t\n\r]*v[\t\n\r]*a[\t\n\r]*s[\t\n\r]*c[\t\n\r]*r[\t\n\r]*i[\t\n\r]*p[\t\n\r]*t[\t\n\r]*:/iu;
|
|
420
|
+
/**
|
|
421
|
+
* Regular expression for matching a valid JavaScript identifier.
|
|
422
|
+
*/
|
|
423
|
+
const JS_IDENTIFIER = /^[_$a-z][\w$]*$/i;
|
|
424
|
+
/**
|
|
425
|
+
* Regular expression for matching a RegExp string.
|
|
426
|
+
*/
|
|
427
|
+
const REGEXP_STR = /^\/(.+)\/([A-Za-z]*)$/u;
|
|
428
|
+
/**
|
|
429
|
+
* Regular expression for matching a `@jsx` annotation comment.
|
|
430
|
+
*/
|
|
431
|
+
const ANNOTATION_JSX = /@jsx\s+(\S+)/u;
|
|
432
|
+
/**
|
|
433
|
+
* Regular expression for matching a `@jsxFrag` annotation comment.
|
|
434
|
+
*/
|
|
435
|
+
const ANNOTATION_JSX_FRAG = /@jsxFrag\s+(\S+)/u;
|
|
436
|
+
/**
|
|
437
|
+
* Regular expression for matching a `@jsxRuntime` annotation comment.
|
|
438
|
+
*/
|
|
439
|
+
const ANNOTATION_JSX_RUNTIME = /@jsxRuntime\s+(\S+)/u;
|
|
440
|
+
/**
|
|
441
|
+
* Regular expression for matching a `@jsxImportSource` annotation comment.
|
|
442
|
+
*/
|
|
443
|
+
const ANNOTATION_JSX_IMPORT_SOURCE = /@jsxImportSource\s+(\S+)/u;
|
|
444
|
+
/**
|
|
445
|
+
* Regular expression for matching a React component name.
|
|
446
|
+
*/
|
|
447
|
+
const COMPONENT_NAME = /^[A-Z]/u;
|
|
448
|
+
/**
|
|
449
|
+
* Regular expression for matching a React component name (loose).
|
|
450
|
+
*/
|
|
451
|
+
const COMPONENT_NAME_LOOSE = /^_?[A-Z]/u;
|
|
452
|
+
/**
|
|
453
|
+
* Regular expression for matching a React Hook name.
|
|
454
|
+
*/
|
|
455
|
+
const HOOK_NAME = /^use/u;
|
|
456
|
+
/**
|
|
457
|
+
* Convert a string to the `RegExp`.
|
|
458
|
+
* Normal strings (e.g. `"foo"`) is converted to `/^foo$/` of `RegExp`.
|
|
459
|
+
* Strings like `"/^foo/i"` are converted to `/^foo/i` of `RegExp`.
|
|
460
|
+
* @see https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/src/utils/regexp.ts
|
|
461
|
+
* @param string The string to convert.
|
|
462
|
+
* @returns Returns the `RegExp`.
|
|
463
|
+
*/
|
|
61
464
|
function toRegExp(string) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
465
|
+
const [, pattern, flags = "u"] = REGEXP_STR.exec(string) ?? [];
|
|
466
|
+
if (pattern != null) return new RegExp(pattern, flags);
|
|
467
|
+
return { test: (s) => s === string };
|
|
65
468
|
}
|
|
469
|
+
/**
|
|
470
|
+
* Checks whether given string is regexp string
|
|
471
|
+
* @param string The string to check
|
|
472
|
+
* @returns boolean
|
|
473
|
+
*/
|
|
66
474
|
function isRegExp(string) {
|
|
67
|
-
|
|
475
|
+
return REGEXP_STR.test(string);
|
|
68
476
|
}
|
|
69
477
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
478
|
+
//#endregion
|
|
479
|
+
//#region src/JsxConfig/JsxConfig.ts
|
|
480
|
+
const JsxEmit = {
|
|
481
|
+
None: 0,
|
|
482
|
+
Preserve: 1,
|
|
483
|
+
React: 2,
|
|
484
|
+
ReactNative: 3,
|
|
485
|
+
ReactJSX: 4,
|
|
486
|
+
ReactJSXDev: 5
|
|
78
487
|
};
|
|
79
|
-
|
|
80
|
-
|
|
488
|
+
/**
|
|
489
|
+
* Create a JsxConfig object
|
|
490
|
+
* @returns JsxConfig
|
|
491
|
+
*/
|
|
492
|
+
function make$2() {
|
|
493
|
+
return {};
|
|
81
494
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Get JsxConfig from RuleContext
|
|
497
|
+
* @param context The RuleContext
|
|
498
|
+
* @returns JsxConfig
|
|
499
|
+
*/
|
|
500
|
+
function getFromContext$1(context) {
|
|
501
|
+
const options = context.sourceCode.parserServices?.program?.getCompilerOptions() ?? {};
|
|
502
|
+
return {
|
|
503
|
+
jsx: options.jsx ?? JsxEmit.ReactJSX,
|
|
504
|
+
jsxFactory: options.jsxFactory ?? "React.createElement",
|
|
505
|
+
jsxFragmentFactory: options.jsxFragmentFactory ?? "React.Fragment",
|
|
506
|
+
jsxImportSource: options.jsxImportSource ?? "react",
|
|
507
|
+
reactNamespace: options.reactNamespace ?? "React"
|
|
508
|
+
};
|
|
91
509
|
}
|
|
92
|
-
|
|
510
|
+
const cache = /* @__PURE__ */ new WeakMap();
|
|
511
|
+
/**
|
|
512
|
+
* Get JsxConfig from annotation
|
|
513
|
+
* @param context The RuleContext
|
|
514
|
+
* @returns JsxConfig
|
|
515
|
+
*/
|
|
93
516
|
function getFromAnnotation(context) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
112
|
-
return options;
|
|
113
|
-
}
|
|
114
|
-
);
|
|
517
|
+
return getOrElseUpdate(cache, context.sourceCode, () => {
|
|
518
|
+
const options = make$2();
|
|
519
|
+
if (!context.sourceCode.text.includes("@jsx")) return options;
|
|
520
|
+
let jsx, jsxFrag, jsxRuntime, jsxImportSource;
|
|
521
|
+
for (const comment of context.sourceCode.getAllComments().reverse()) {
|
|
522
|
+
const value = comment.value;
|
|
523
|
+
jsx ??= value.match(ANNOTATION_JSX)?.[1];
|
|
524
|
+
jsxFrag ??= value.match(ANNOTATION_JSX_FRAG)?.[1];
|
|
525
|
+
jsxRuntime ??= value.match(ANNOTATION_JSX_RUNTIME)?.[1];
|
|
526
|
+
jsxImportSource ??= value.match(ANNOTATION_JSX_IMPORT_SOURCE)?.[1];
|
|
527
|
+
}
|
|
528
|
+
if (jsx != null) options.jsxFactory = jsx;
|
|
529
|
+
if (jsxFrag != null) options.jsxFragmentFactory = jsxFrag;
|
|
530
|
+
if (jsxRuntime != null) options.jsx = jsxRuntime === "classic" ? JsxEmit.React : JsxEmit.ReactJSX;
|
|
531
|
+
if (jsxImportSource != null) options.jsxImportSource = jsxImportSource;
|
|
532
|
+
return options;
|
|
533
|
+
});
|
|
115
534
|
}
|
|
116
535
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/JsxConfig/index.ts
|
|
538
|
+
var JsxConfig_exports = {};
|
|
539
|
+
__export(JsxConfig_exports, {
|
|
540
|
+
JsxEmit: () => JsxEmit,
|
|
541
|
+
getFromAnnotation: () => getFromAnnotation,
|
|
542
|
+
getFromContext: () => getFromContext$1,
|
|
543
|
+
make: () => make$2
|
|
124
544
|
});
|
|
125
545
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
546
|
+
//#endregion
|
|
547
|
+
//#region src/LanguagePreference/LanguagePreference.ts
|
|
548
|
+
/**
|
|
549
|
+
* Get a copy of the default LanguagePreference.
|
|
550
|
+
*/
|
|
551
|
+
function make$1() {
|
|
552
|
+
return {
|
|
553
|
+
indentStyle: "space",
|
|
554
|
+
indentWidth: 2,
|
|
555
|
+
jsxQuoteStyle: "double",
|
|
556
|
+
quoteStyle: "single",
|
|
557
|
+
semicolons: "always",
|
|
558
|
+
trailingCommas: "all"
|
|
559
|
+
};
|
|
136
560
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
561
|
+
/**
|
|
562
|
+
* A default LanguagePreference object.
|
|
563
|
+
*/
|
|
564
|
+
const defaultLanguagePreference = make$1();
|
|
565
|
+
function getFromContext() {
|
|
566
|
+
throw new Error("getFromContext is not implemented");
|
|
140
567
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
z.literal("asNeeded")
|
|
159
|
-
])
|
|
160
|
-
),
|
|
161
|
-
trailingCommas: z.optional(
|
|
162
|
-
z.union([
|
|
163
|
-
z.literal("all"),
|
|
164
|
-
z.literal("es5"),
|
|
165
|
-
z.literal("none")
|
|
166
|
-
])
|
|
167
|
-
),
|
|
168
|
-
// JSX specific options
|
|
169
|
-
jsxQuoteStyle: z.optional(
|
|
170
|
-
z.union([
|
|
171
|
-
z.literal("single"),
|
|
172
|
-
z.literal("double")
|
|
173
|
-
])
|
|
174
|
-
)
|
|
568
|
+
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region src/LanguagePreference/LanguagePreferenceSchema.ts
|
|
571
|
+
/**
|
|
572
|
+
* @internal
|
|
573
|
+
*/
|
|
574
|
+
const LanguagePreferenceSchema = z.object({
|
|
575
|
+
indentStyle: z.optional(z.union([z.literal("tab"), z.literal("space")])),
|
|
576
|
+
indentWidth: z.optional(z.number()),
|
|
577
|
+
quoteStyle: z.optional(z.union([z.literal("single"), z.literal("double")])),
|
|
578
|
+
semicolons: z.optional(z.union([z.literal("always"), z.literal("asNeeded")])),
|
|
579
|
+
trailingCommas: z.optional(z.union([
|
|
580
|
+
z.literal("all"),
|
|
581
|
+
z.literal("es5"),
|
|
582
|
+
z.literal("none")
|
|
583
|
+
])),
|
|
584
|
+
jsxQuoteStyle: z.optional(z.union([z.literal("single"), z.literal("double")]))
|
|
175
585
|
}, {});
|
|
176
586
|
|
|
177
|
-
|
|
587
|
+
//#endregion
|
|
588
|
+
//#region src/LanguagePreference/index.ts
|
|
589
|
+
var LanguagePreference_exports = {};
|
|
590
|
+
__export(LanguagePreference_exports, {
|
|
591
|
+
LanguagePreferenceSchema: () => LanguagePreferenceSchema,
|
|
592
|
+
defaultLanguagePreference: () => defaultLanguagePreference,
|
|
593
|
+
getFromContext: () => getFromContext,
|
|
594
|
+
make: () => make$1
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
//#endregion
|
|
598
|
+
//#region src/Reporter.ts
|
|
178
599
|
var Reporter_exports = {};
|
|
179
600
|
__export(Reporter_exports, {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
601
|
+
make: () => make,
|
|
602
|
+
send: () => send,
|
|
603
|
+
sendOrElse: () => sendOrElse
|
|
183
604
|
});
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
605
|
+
const send = dual(2, (context, descriptor) => {
|
|
606
|
+
if (descriptor == null) return;
|
|
607
|
+
return context.report(descriptor);
|
|
187
608
|
});
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
609
|
+
const sendOrElse = dual(3, (context, descriptor, cb) => {
|
|
610
|
+
if (descriptor == null) return cb();
|
|
611
|
+
return context.report(descriptor);
|
|
191
612
|
});
|
|
192
|
-
function
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
613
|
+
function make(context) {
|
|
614
|
+
return {
|
|
615
|
+
send: (...args) => send(context, ...args),
|
|
616
|
+
sendOrElse: (...args) => sendOrElse(context, ...args)
|
|
617
|
+
};
|
|
197
618
|
}
|
|
198
619
|
|
|
199
|
-
|
|
620
|
+
//#endregion
|
|
621
|
+
//#region src/Selector.ts
|
|
200
622
|
var Selector_exports = {};
|
|
201
623
|
__export(Selector_exports, {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
624
|
+
DISPLAY_NAME_ASSIGNMENT_EXPRESSION: () => DISPLAY_NAME_ASSIGNMENT_EXPRESSION,
|
|
625
|
+
IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION: () => IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION,
|
|
626
|
+
OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: () => OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR
|
|
205
627
|
});
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
628
|
+
const IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION = "ArrowFunctionExpression[body.type!='BlockStatement']";
|
|
629
|
+
const OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR = [
|
|
630
|
+
"VariableDeclarator",
|
|
631
|
+
"[id.type='ObjectPattern']",
|
|
632
|
+
"[init.type='Identifier']"
|
|
211
633
|
].join("");
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
634
|
+
const DISPLAY_NAME_ASSIGNMENT_EXPRESSION = [
|
|
635
|
+
"AssignmentExpression",
|
|
636
|
+
"[operator='=']",
|
|
637
|
+
"[left.type='MemberExpression']",
|
|
638
|
+
"[left.property.name='displayName']"
|
|
217
639
|
].join("");
|
|
218
640
|
|
|
219
|
-
|
|
641
|
+
//#endregion
|
|
642
|
+
export { ContextDetection_exports as ContextDetection, JsxConfig_exports as JsxConfig, LanguagePreference_exports as LanguagePreference, RegExp_exports as RegExp, Reporter_exports as Reporter, Selector_exports as Selector };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/kit",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.61",
|
|
4
4
|
"description": "ESLint React's plugin kit for building plugins and rules.",
|
|
5
5
|
"homepage": "https://github.com/Rel1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -27,23 +27,23 @@
|
|
|
27
27
|
"./package.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@typescript-eslint/utils": "^8.
|
|
31
|
-
"ts-pattern": "^5.
|
|
32
|
-
"zod": "^
|
|
33
|
-
"@eslint-react/
|
|
30
|
+
"@typescript-eslint/utils": "^8.41.0",
|
|
31
|
+
"ts-pattern": "^5.8.0",
|
|
32
|
+
"zod": "^4.1.5",
|
|
33
|
+
"@eslint-react/ast": "2.0.0-next.61",
|
|
34
|
+
"@eslint-react/eff": "2.0.0-next.61"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
37
|
"@tsconfig/node22": "^22.0.2",
|
|
37
|
-
"
|
|
38
|
+
"tsdown": "^0.14.2",
|
|
38
39
|
"type-fest": "^4.41.0",
|
|
39
40
|
"@local/configs": "0.0.0"
|
|
40
41
|
},
|
|
41
42
|
"engines": {
|
|
42
|
-
"bun": ">=1.0.15",
|
|
43
43
|
"node": ">=20.19.0"
|
|
44
44
|
},
|
|
45
45
|
"scripts": {
|
|
46
|
-
"build": "
|
|
46
|
+
"build": "tsdown --dts-resolve",
|
|
47
47
|
"build:docs": "typedoc",
|
|
48
48
|
"lint:publish": "publint",
|
|
49
49
|
"lint:ts": "tsc --noEmit"
|