@eslint-react/kit 2.0.0-next.145 → 2.0.0-next.147

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.
@@ -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,11 +1,15 @@
1
- import { unit } from '@eslint-react/eff';
2
- import { TSESTree } from '@typescript-eslint/types';
3
- import * as typescript from 'typescript';
4
- import * as tseslint from '@typescript-eslint/utils/ts-eslint';
5
- import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
6
- import { z } from 'zod/v4';
7
- import { TSESTree as TSESTree$1 } from '@typescript-eslint/utils';
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";
8
8
 
9
+ //#region src/ContextDetection.d.ts
10
+ declare namespace ContextDetection_d_exports {
11
+ export { isProcessEnvNodeEnv, isProcessEnvNodeEnvCompare, isViMock, isViMockCallback };
12
+ }
9
13
  /**
10
14
  * Check if the given node is a member expression that accesses `process.env.NODE_ENV`
11
15
  * @param node The AST node
@@ -34,15 +38,8 @@ declare function isViMock(node: TSESTree.Node | null | unit): node is TSESTree.M
34
38
  * @internal
35
39
  */
36
40
  declare function isViMockCallback(node: TSESTree.Node | null | unit): boolean;
37
-
38
- declare const ContextDetection_isProcessEnvNodeEnv: typeof isProcessEnvNodeEnv;
39
- declare const ContextDetection_isProcessEnvNodeEnvCompare: typeof isProcessEnvNodeEnvCompare;
40
- declare const ContextDetection_isViMock: typeof isViMock;
41
- declare const ContextDetection_isViMockCallback: typeof isViMockCallback;
42
- declare namespace ContextDetection {
43
- export { ContextDetection_isProcessEnvNodeEnv as isProcessEnvNodeEnv, ContextDetection_isProcessEnvNodeEnvCompare as isProcessEnvNodeEnvCompare, ContextDetection_isViMock as isViMock, ContextDetection_isViMockCallback as isViMockCallback };
44
- }
45
-
41
+ //#endregion
42
+ //#region src/types.d.ts
46
43
  /**
47
44
  * Rule severity.
48
45
  * @since 0.0.1
@@ -71,24 +68,25 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
71
68
  type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
72
69
  type RulePolicy = number;
73
70
  type RuleSuggest<MessageIds extends string = string> = {
74
- messageId: MessageIds;
75
- data?: Record<string, unknown>;
76
- fix: tseslint.ReportFixFunction;
71
+ messageId: MessageIds;
72
+ data?: Record<string, unknown>;
73
+ fix: tseslint.ReportFixFunction;
77
74
  };
78
-
75
+ //#endregion
76
+ //#region src/JsxConfig/JsxConfig.d.ts
79
77
  declare const JsxEmit: {
80
- readonly None: 0;
81
- readonly Preserve: 1;
82
- readonly React: 2;
83
- readonly ReactNative: 3;
84
- readonly ReactJSX: 4;
85
- readonly ReactJSXDev: 5;
78
+ readonly None: 0;
79
+ readonly Preserve: 1;
80
+ readonly React: 2;
81
+ readonly ReactNative: 3;
82
+ readonly ReactJSX: 4;
83
+ readonly ReactJSXDev: 5;
86
84
  };
87
85
  interface JsxConfig {
88
- jsx?: number;
89
- jsxFactory?: string;
90
- jsxFragmentFactory?: string;
91
- jsxImportSource?: string;
86
+ jsx?: number;
87
+ jsxFactory?: string;
88
+ jsxFragmentFactory?: string;
89
+ jsxImportSource?: string;
92
90
  }
93
91
  /**
94
92
  * Create a JsxConfig object
@@ -101,11 +99,11 @@ declare function make$2(): JsxConfig;
101
99
  * @returns JsxConfig
102
100
  */
103
101
  declare function getFromContext$1(context: RuleContext): {
104
- jsx: 4 | typescript.JsxEmit;
105
- jsxFactory: string;
106
- jsxFragmentFactory: string;
107
- jsxImportSource: string;
108
- reactNamespace: string;
102
+ jsx: 4 | typescript0.JsxEmit;
103
+ jsxFactory: string;
104
+ jsxFragmentFactory: string;
105
+ jsxImportSource: string;
106
+ reactNamespace: string;
109
107
  };
110
108
  /**
111
109
  * Get JsxConfig from annotation
@@ -113,26 +111,24 @@ declare function getFromContext$1(context: RuleContext): {
113
111
  * @returns JsxConfig
114
112
  */
115
113
  declare function getFromAnnotation(context: RuleContext): JsxConfig;
116
-
117
- type index$1_JsxConfig = JsxConfig;
118
- declare const index$1_JsxEmit: typeof JsxEmit;
119
- declare const index$1_getFromAnnotation: typeof getFromAnnotation;
120
- declare namespace index$1 {
121
- 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 };
114
+ declare namespace index_d_exports {
115
+ export { JsxConfig, JsxEmit, getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
122
116
  }
123
-
117
+ //#endregion
118
+ //#region src/LanguagePreference/LanguagePreferenceSchema.d.ts
124
119
  /**
125
120
  * @internal
126
121
  */
127
122
  declare const LanguagePreferenceSchema: z.ZodObject<{
128
- indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
129
- indentWidth: z.ZodOptional<z.ZodNumber>;
130
- quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
131
- semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
132
- trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
133
- jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
123
+ indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
124
+ indentWidth: z.ZodOptional<z.ZodNumber>;
125
+ quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
126
+ semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
127
+ trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
128
+ jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
134
129
  }, z.core.$strip>;
135
-
130
+ //#endregion
131
+ //#region src/LanguagePreference/LanguagePreference.d.ts
136
132
  /**
137
133
  * @internal
138
134
  */
@@ -145,27 +141,23 @@ declare function make$1(): LanguagePreference;
145
141
  * A default LanguagePreference object.
146
142
  */
147
143
  declare const defaultLanguagePreference: {
148
- indentStyle?: "tab" | "space" | undefined;
149
- indentWidth?: number | undefined;
150
- quoteStyle?: "single" | "double" | undefined;
151
- semicolons?: "always" | "asNeeded" | undefined;
152
- trailingCommas?: "all" | "es5" | "none" | undefined;
153
- jsxQuoteStyle?: "single" | "double" | undefined;
144
+ indentStyle?: "tab" | "space" | undefined;
145
+ indentWidth?: number | undefined;
146
+ quoteStyle?: "single" | "double" | undefined;
147
+ semicolons?: "always" | "asNeeded" | undefined;
148
+ trailingCommas?: "all" | "es5" | "none" | undefined;
149
+ jsxQuoteStyle?: "single" | "double" | undefined;
154
150
  };
155
151
  declare function getFromContext(): void;
156
152
  declare module "@typescript-eslint/utils/ts-eslint" {
157
- interface SharedConfigurationSettings {
158
- }
153
+ interface SharedConfigurationSettings {}
159
154
  }
160
-
161
- type index_LanguagePreference = LanguagePreference;
162
- declare const index_LanguagePreferenceSchema: typeof LanguagePreferenceSchema;
163
- declare const index_defaultLanguagePreference: typeof defaultLanguagePreference;
164
- declare const index_getFromContext: typeof getFromContext;
165
- declare namespace index {
166
- export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_defaultLanguagePreference as defaultLanguagePreference, index_getFromContext as getFromContext, make$1 as make };
155
+ declare namespace index_d_exports$1 {
156
+ export { LanguagePreference, LanguagePreferenceSchema, defaultLanguagePreference, getFromContext, make$1 as make };
157
+ }
158
+ declare namespace RegExp_d_exports {
159
+ 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 };
167
160
  }
168
-
169
161
  /**
170
162
  * Regular expressions for matching a HTML tag name
171
163
  */
@@ -244,7 +236,7 @@ declare const HOOK_NAME: RegExp;
244
236
  * @returns Returns the `RegExp`.
245
237
  */
246
238
  declare function toRegExp(string: string): {
247
- test(s: string): boolean;
239
+ test(s: string): boolean;
248
240
  };
249
241
  /**
250
242
  * Checks whether given string is regexp string
@@ -252,82 +244,44 @@ declare function toRegExp(string: string): {
252
244
  * @returns boolean
253
245
  */
254
246
  declare function isRegExp(string: string): boolean;
255
-
256
- declare const RegExp$1_ANNOTATION_JSX: typeof ANNOTATION_JSX;
257
- declare const RegExp$1_ANNOTATION_JSX_FRAG: typeof ANNOTATION_JSX_FRAG;
258
- declare const RegExp$1_ANNOTATION_JSX_IMPORT_SOURCE: typeof ANNOTATION_JSX_IMPORT_SOURCE;
259
- declare const RegExp$1_ANNOTATION_JSX_RUNTIME: typeof ANNOTATION_JSX_RUNTIME;
260
- declare const RegExp$1_CAMEL_CASE: typeof CAMEL_CASE;
261
- declare const RegExp$1_COMPONENT_NAME: typeof COMPONENT_NAME;
262
- declare const RegExp$1_COMPONENT_NAME_LOOSE: typeof COMPONENT_NAME_LOOSE;
263
- declare const RegExp$1_CONSTANT_CASE: typeof CONSTANT_CASE;
264
- declare const RegExp$1_HOOK_NAME: typeof HOOK_NAME;
265
- declare const RegExp$1_HTML_TAG: typeof HTML_TAG;
266
- declare const RegExp$1_JAVASCRIPT_PROTOCOL: typeof JAVASCRIPT_PROTOCOL;
267
- declare const RegExp$1_JS_EXT: typeof JS_EXT;
268
- declare const RegExp$1_JS_IDENTIFIER: typeof JS_IDENTIFIER;
269
- declare const RegExp$1_KEBAB_CASE: typeof KEBAB_CASE;
270
- declare const RegExp$1_PASCAL_CASE: typeof PASCAL_CASE;
271
- declare const RegExp$1_REGEXP_STR: typeof REGEXP_STR;
272
- declare const RegExp$1_SNAKE_CASE: typeof SNAKE_CASE;
273
- declare const RegExp$1_TS_EXT: typeof TS_EXT;
274
- declare const RegExp$1_isRegExp: typeof isRegExp;
275
- declare const RegExp$1_toRegExp: typeof toRegExp;
276
- declare namespace RegExp$1 {
277
- 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 };
247
+ declare namespace Reporter_d_exports {
248
+ export { Reporter, make, send, sendOrElse };
278
249
  }
279
-
280
250
  interface Reporter<TMessageID extends string> {
281
- send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
282
- sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
251
+ send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
252
+ sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
283
253
  }
284
254
  declare const send: {
285
- <TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
286
- <TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
255
+ <TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
256
+ <TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
287
257
  };
288
258
  declare const sendOrElse: {
289
- <TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
290
- <TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
259
+ <TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
260
+ <TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
291
261
  };
292
262
  declare function make<TMessageID extends string>(context: RuleContext): Reporter<TMessageID>;
293
-
294
- type Reporter$1_Reporter<TMessageID extends string> = Reporter<TMessageID>;
295
- declare const Reporter$1_make: typeof make;
296
- declare const Reporter$1_send: typeof send;
297
- declare const Reporter$1_sendOrElse: typeof sendOrElse;
298
- declare namespace Reporter$1 {
299
- export { type Reporter$1_Reporter as Reporter, Reporter$1_make as make, Reporter$1_send as send, Reporter$1_sendOrElse as sendOrElse };
263
+ declare namespace Selector_d_exports {
264
+ export { DISPLAY_NAME_ASSIGNMENT_EXPRESSION, DisplayNameAssignmentExpression, IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, ImplicitReturnArrowFunctionExpression, OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, ObjectDestructuringVariableDeclarator };
300
265
  }
301
-
302
266
  type ImplicitReturnArrowFunctionExpression = TSESTree$1.ArrowFunctionExpression & {
303
- body: TSESTree$1.Expression;
267
+ body: TSESTree$1.Expression;
304
268
  };
305
269
  type ObjectDestructuringVariableDeclarator = TSESTree$1.VariableDeclarator & {
306
- id: TSESTree$1.ObjectPattern;
307
- init: TSESTree$1.Identifier;
270
+ id: TSESTree$1.ObjectPattern;
271
+ init: TSESTree$1.Identifier;
308
272
  };
309
273
  type DisplayNameAssignmentExpression = TSESTree$1.AssignmentExpression & {
310
- type: "AssignmentExpression";
311
- left: TSESTree$1.MemberExpression & {
312
- property: TSESTree$1.Identifier & {
313
- name: "displayName";
314
- };
274
+ type: "AssignmentExpression";
275
+ left: TSESTree$1.MemberExpression & {
276
+ property: TSESTree$1.Identifier & {
277
+ name: "displayName";
315
278
  };
316
- operator: "=";
317
- right: TSESTree$1.Literal;
279
+ };
280
+ operator: "=";
281
+ right: TSESTree$1.Literal;
318
282
  };
319
283
  declare const IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION = "ArrowFunctionExpression[body.type!='BlockStatement']";
320
284
  declare const OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: string;
321
285
  declare const DISPLAY_NAME_ASSIGNMENT_EXPRESSION: string;
322
-
323
- declare const Selector_DISPLAY_NAME_ASSIGNMENT_EXPRESSION: typeof DISPLAY_NAME_ASSIGNMENT_EXPRESSION;
324
- type Selector_DisplayNameAssignmentExpression = DisplayNameAssignmentExpression;
325
- declare const Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION: typeof IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION;
326
- type Selector_ImplicitReturnArrowFunctionExpression = ImplicitReturnArrowFunctionExpression;
327
- declare const Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR: typeof OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR;
328
- type Selector_ObjectDestructuringVariableDeclarator = ObjectDestructuringVariableDeclarator;
329
- declare namespace Selector {
330
- 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 };
331
- }
332
-
333
- export { ContextDetection, 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 };
286
+ //#endregion
287
+ export { 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, RuleContext, RuleDeclaration, RuleFeature, RulePolicy, RulePreset, RuleSeverity, RuleSuggest, Selector_d_exports as Selector };