@eslint-react/kit 2.0.0-next.5 → 2.0.0-next.50
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/index.d.ts +54 -22
- package/dist/index.js +12 -2
- package/package.json +8 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import * as typescript from 'typescript';
|
|
1
2
|
import * as tseslint from '@typescript-eslint/utils/ts-eslint';
|
|
2
3
|
import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import { _ } from '@eslint-react/eff';
|
|
4
|
+
import { z } from 'zod/v4';
|
|
5
|
+
import { unit } from '@eslint-react/eff';
|
|
6
6
|
import { TSESTree } from '@typescript-eslint/utils';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -31,8 +31,27 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
|
|
|
31
31
|
* @since 1.20.0
|
|
32
32
|
*/
|
|
33
33
|
type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
|
|
34
|
+
type RulePolicy = number;
|
|
35
|
+
type RuleSuggest<MessageIds extends string = string> = {
|
|
36
|
+
messageId: MessageIds;
|
|
37
|
+
data?: Record<string, unknown>;
|
|
38
|
+
fix: tseslint.ReportFixFunction;
|
|
39
|
+
};
|
|
34
40
|
|
|
35
|
-
|
|
41
|
+
declare const JsxEmit: {
|
|
42
|
+
readonly None: 0;
|
|
43
|
+
readonly Preserve: 1;
|
|
44
|
+
readonly React: 2;
|
|
45
|
+
readonly ReactNative: 3;
|
|
46
|
+
readonly ReactJSX: 4;
|
|
47
|
+
readonly ReactJSXDev: 5;
|
|
48
|
+
};
|
|
49
|
+
interface JsxConfig {
|
|
50
|
+
jsx?: number;
|
|
51
|
+
jsxFactory?: string;
|
|
52
|
+
jsxFragmentFactory?: string;
|
|
53
|
+
jsxImportSource?: string;
|
|
54
|
+
}
|
|
36
55
|
/**
|
|
37
56
|
* Create a JsxConfig object
|
|
38
57
|
* @returns JsxConfig
|
|
@@ -44,7 +63,7 @@ declare function make$2(): JsxConfig;
|
|
|
44
63
|
* @returns JsxConfig
|
|
45
64
|
*/
|
|
46
65
|
declare function getFromContext$1(context: RuleContext): {
|
|
47
|
-
jsx: JsxEmit;
|
|
66
|
+
jsx: 4 | typescript.JsxEmit;
|
|
48
67
|
jsxFactory: string;
|
|
49
68
|
jsxFragmentFactory: string;
|
|
50
69
|
jsxImportSource: string;
|
|
@@ -58,22 +77,23 @@ declare function getFromContext$1(context: RuleContext): {
|
|
|
58
77
|
declare function getFromAnnotation(context: RuleContext): JsxConfig;
|
|
59
78
|
|
|
60
79
|
type index$1_JsxConfig = JsxConfig;
|
|
80
|
+
declare const index$1_JsxEmit: typeof JsxEmit;
|
|
61
81
|
declare const index$1_getFromAnnotation: typeof getFromAnnotation;
|
|
62
82
|
declare namespace index$1 {
|
|
63
|
-
export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
|
|
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 };
|
|
64
84
|
}
|
|
65
85
|
|
|
66
86
|
/**
|
|
67
87
|
* @internal
|
|
68
88
|
*/
|
|
69
|
-
declare const LanguagePreferenceSchema: z.
|
|
70
|
-
indentStyle: z.
|
|
71
|
-
indentWidth: z.
|
|
72
|
-
quoteStyle: z.
|
|
73
|
-
semicolons: z.
|
|
74
|
-
trailingCommas: z.
|
|
75
|
-
jsxQuoteStyle: z.
|
|
76
|
-
},
|
|
89
|
+
declare const LanguagePreferenceSchema: z.ZodObject<{
|
|
90
|
+
indentStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"tab">, z.ZodLiteral<"space">]>>;
|
|
91
|
+
indentWidth: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
quoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
93
|
+
semicolons: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"always">, z.ZodLiteral<"asNeeded">]>>;
|
|
94
|
+
trailingCommas: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"all">, z.ZodLiteral<"es5">, z.ZodLiteral<"none">]>>;
|
|
95
|
+
jsxQuoteStyle: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"single">, z.ZodLiteral<"double">]>>;
|
|
96
|
+
}, z.core.$strip>;
|
|
77
97
|
|
|
78
98
|
/**
|
|
79
99
|
* @internal
|
|
@@ -83,6 +103,17 @@ type LanguagePreference = z.infer<typeof LanguagePreferenceSchema>;
|
|
|
83
103
|
* Get a copy of the default LanguagePreference.
|
|
84
104
|
*/
|
|
85
105
|
declare function make$1(): LanguagePreference;
|
|
106
|
+
/**
|
|
107
|
+
* A default LanguagePreference object.
|
|
108
|
+
*/
|
|
109
|
+
declare const defaultLanguagePreference: {
|
|
110
|
+
indentStyle?: "tab" | "space" | undefined;
|
|
111
|
+
indentWidth?: number | undefined;
|
|
112
|
+
quoteStyle?: "single" | "double" | undefined;
|
|
113
|
+
semicolons?: "always" | "asNeeded" | undefined;
|
|
114
|
+
trailingCommas?: "all" | "es5" | "none" | undefined;
|
|
115
|
+
jsxQuoteStyle?: "single" | "double" | undefined;
|
|
116
|
+
};
|
|
86
117
|
declare function getFromContext(): void;
|
|
87
118
|
declare module "@typescript-eslint/utils/ts-eslint" {
|
|
88
119
|
interface SharedConfigurationSettings {
|
|
@@ -91,9 +122,10 @@ declare module "@typescript-eslint/utils/ts-eslint" {
|
|
|
91
122
|
|
|
92
123
|
type index_LanguagePreference = LanguagePreference;
|
|
93
124
|
declare const index_LanguagePreferenceSchema: typeof LanguagePreferenceSchema;
|
|
125
|
+
declare const index_defaultLanguagePreference: typeof defaultLanguagePreference;
|
|
94
126
|
declare const index_getFromContext: typeof getFromContext;
|
|
95
127
|
declare namespace index {
|
|
96
|
-
export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_getFromContext as getFromContext, make$1 as make };
|
|
128
|
+
export { type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_defaultLanguagePreference as defaultLanguagePreference, index_getFromContext as getFromContext, make$1 as make };
|
|
97
129
|
}
|
|
98
130
|
|
|
99
131
|
/**
|
|
@@ -208,16 +240,16 @@ declare namespace RegExp$1 {
|
|
|
208
240
|
}
|
|
209
241
|
|
|
210
242
|
interface Reporter<TMessageID extends string> {
|
|
211
|
-
send: (descriptor:
|
|
212
|
-
sendOrElse: <TElse>(descriptor:
|
|
243
|
+
send: (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
244
|
+
sendOrElse: <TElse>(descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse) => unit | TElse;
|
|
213
245
|
}
|
|
214
246
|
declare const send: {
|
|
215
|
-
<TMessageID extends string>(context: RuleContext, descriptor:
|
|
216
|
-
<TMessageID extends string>(context: RuleContext): (descriptor:
|
|
247
|
+
<TMessageID extends string>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>): void;
|
|
248
|
+
<TMessageID extends string>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => void;
|
|
217
249
|
};
|
|
218
250
|
declare const sendOrElse: {
|
|
219
|
-
<TMessageID extends string, TElse>(context: RuleContext, descriptor:
|
|
220
|
-
<TMessageID extends string, TElse>(context: RuleContext): (descriptor:
|
|
251
|
+
<TMessageID extends string, TElse>(context: RuleContext, descriptor: unit | null | ReportDescriptor<TMessageID>, cb: () => TElse): unit | TElse;
|
|
252
|
+
<TMessageID extends string, TElse>(context: RuleContext): (descriptor: unit | null | ReportDescriptor<TMessageID>) => (cb: () => TElse) => unit | TElse;
|
|
221
253
|
};
|
|
222
254
|
declare function make<TMessageID extends string>(context: RuleContext): Reporter<TMessageID>;
|
|
223
255
|
|
|
@@ -260,4 +292,4 @@ declare namespace Selector {
|
|
|
260
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 };
|
|
261
293
|
}
|
|
262
294
|
|
|
263
|
-
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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { dual, getOrElseUpdate } from '@eslint-react/eff';
|
|
2
|
-
import {
|
|
3
|
-
import * as z from '@zod/mini';
|
|
2
|
+
import { z } from 'zod/v4';
|
|
4
3
|
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
@@ -11,6 +10,7 @@ var __export = (target, all) => {
|
|
|
11
10
|
// src/JsxConfig/index.ts
|
|
12
11
|
var JsxConfig_exports = {};
|
|
13
12
|
__export(JsxConfig_exports, {
|
|
13
|
+
JsxEmit: () => JsxEmit,
|
|
14
14
|
getFromAnnotation: () => getFromAnnotation,
|
|
15
15
|
getFromContext: () => getFromContext,
|
|
16
16
|
make: () => make
|
|
@@ -68,6 +68,14 @@ function isRegExp(string) {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
// src/JsxConfig/JsxConfig.ts
|
|
71
|
+
var JsxEmit = {
|
|
72
|
+
None: 0,
|
|
73
|
+
Preserve: 1,
|
|
74
|
+
React: 2,
|
|
75
|
+
ReactNative: 3,
|
|
76
|
+
ReactJSX: 4,
|
|
77
|
+
ReactJSXDev: 5
|
|
78
|
+
};
|
|
71
79
|
function make() {
|
|
72
80
|
return {};
|
|
73
81
|
}
|
|
@@ -110,6 +118,7 @@ function getFromAnnotation(context) {
|
|
|
110
118
|
var LanguagePreference_exports = {};
|
|
111
119
|
__export(LanguagePreference_exports, {
|
|
112
120
|
LanguagePreferenceSchema: () => LanguagePreferenceSchema,
|
|
121
|
+
defaultLanguagePreference: () => defaultLanguagePreference,
|
|
113
122
|
getFromContext: () => getFromContext2,
|
|
114
123
|
make: () => make2
|
|
115
124
|
});
|
|
@@ -125,6 +134,7 @@ function make2() {
|
|
|
125
134
|
trailingCommas: "all"
|
|
126
135
|
};
|
|
127
136
|
}
|
|
137
|
+
var defaultLanguagePreference = make2();
|
|
128
138
|
function getFromContext2() {
|
|
129
139
|
throw new Error("getFromContext is not implemented");
|
|
130
140
|
}
|
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.50",
|
|
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,15 +27,15 @@
|
|
|
27
27
|
"./package.json"
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@typescript-eslint/utils": "^8.
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"@eslint-react/eff": "2.0.0-next.
|
|
30
|
+
"@typescript-eslint/utils": "^8.34.1",
|
|
31
|
+
"ts-pattern": "^5.7.1",
|
|
32
|
+
"zod": "^3.25.67",
|
|
33
|
+
"@eslint-react/eff": "2.0.0-next.50"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@tsconfig/node22": "^22.0.
|
|
37
|
-
"tsup": "^8.
|
|
38
|
-
"type-fest": "^4.
|
|
36
|
+
"@tsconfig/node22": "^22.0.2",
|
|
37
|
+
"tsup": "^8.5.0",
|
|
38
|
+
"type-fest": "^4.41.0",
|
|
39
39
|
"@local/configs": "0.0.0"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|