@eslint-react/kit 1.45.4-next.1 → 1.45.4-next.2

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.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ } from '@eslint-react/eff';
2
1
  import * as tseslint from '@typescript-eslint/utils/ts-eslint';
3
2
  import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
4
3
  import { CompilerOptions, JsxEmit } from 'typescript';
5
4
  import * as valibot from 'valibot';
6
5
  import { InferOutput } from 'valibot';
6
+ import { _ } from '@eslint-react/eff';
7
7
  import { TSESTree } from '@typescript-eslint/utils';
8
8
 
9
9
  /**
@@ -33,19 +33,12 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
33
33
  */
34
34
  type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
35
35
 
36
- /**
37
- * Creates a report function that can conditionally report a descriptor.
38
- * @param context - The context of the rule
39
- * @returns A function that takes a descriptor and reports it if it's not null or undefined
40
- */
41
- declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
42
-
43
36
  type JsxConfig = Pick<CompilerOptions, "reactNamespace" | "jsx" | "jsxFactory" | "jsxFragmentFactory" | "jsxImportSource">;
44
37
  /**
45
38
  * Create a JsxConfig object
46
39
  * @returns JsxConfig
47
40
  */
48
- declare function make$1(): JsxConfig;
41
+ declare function make$2(): JsxConfig;
49
42
  /**
50
43
  * Get JsxConfig from RuleContext
51
44
  * @param context The RuleContext
@@ -68,7 +61,7 @@ declare function getFromAnnotation(context: RuleContext): JsxConfig;
68
61
  type index$1_JsxConfig = JsxConfig;
69
62
  declare const index$1_getFromAnnotation: typeof getFromAnnotation;
70
63
  declare namespace index$1 {
71
- export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$1 as make };
64
+ export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
72
65
  }
73
66
 
74
67
  /**
@@ -101,7 +94,7 @@ declare const DEFAULT_LANGUAGE_PREFERENCE: {
101
94
  /**
102
95
  * Get a copy of the default LanguagePreference.
103
96
  */
104
- declare function make(): LanguagePreference;
97
+ declare function make$1(): LanguagePreference;
105
98
  declare function getFromContext(): void;
106
99
  declare module "@typescript-eslint/utils/ts-eslint" {
107
100
  interface SharedConfigurationSettings {
@@ -112,9 +105,8 @@ declare const index_DEFAULT_LANGUAGE_PREFERENCE: typeof DEFAULT_LANGUAGE_PREFERE
112
105
  type index_LanguagePreference = LanguagePreference;
113
106
  declare const index_LanguagePreferenceSchema: typeof LanguagePreferenceSchema;
114
107
  declare const index_getFromContext: typeof getFromContext;
115
- declare const index_make: typeof make;
116
108
  declare namespace index {
117
- export { index_DEFAULT_LANGUAGE_PREFERENCE as DEFAULT_LANGUAGE_PREFERENCE, type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_getFromContext as getFromContext, index_make as make };
109
+ export { index_DEFAULT_LANGUAGE_PREFERENCE as DEFAULT_LANGUAGE_PREFERENCE, type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_getFromContext as getFromContext, make$1 as make };
118
110
  }
119
111
 
120
112
  /**
@@ -223,6 +215,16 @@ declare namespace RE {
223
215
  export { RE_ANNOTATION_JSX as ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG as ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE as ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME as ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE as CAMEL_CASE, RE_COMPONENT_NAME as COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE as COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE as CONSTANT_CASE, RE_HOOK_NAME as HOOK_NAME, RE_JAVASCRIPT_PROTOCOL as JAVASCRIPT_PROTOCOL, RE_JS_EXT as JS_EXT, RE_JS_IDENTIFIER as JS_IDENTIFIER, RE_KEBAB_CASE as KEBAB_CASE, RE_PASCAL_CASE as PASCAL_CASE, RE_REGEXP_STR as REGEXP_STR, RE_SNAKE_CASE as SNAKE_CASE, RE_TS_EXT as TS_EXT, RE_isRegExp as isRegExp, RE_toRegExp as toRegExp };
224
216
  }
225
217
 
218
+ declare function make<TMessageID extends string>(context: RuleContext<TMessageID>): {
219
+ readonly send: (descriptor: _ | null | ReportDescriptor<TMessageID>) => void;
220
+ readonly sendOrElse: <TElse>(descriptor: _ | null | ReportDescriptor<TMessageID>, fallback: () => TElse) => void | TElse;
221
+ };
222
+
223
+ declare const Report_make: typeof make;
224
+ declare namespace Report {
225
+ export { Report_make as make };
226
+ }
227
+
226
228
  type ImplicitReturnArrowFunctionExpression = TSESTree.ArrowFunctionExpression & {
227
229
  body: TSESTree.Expression;
228
230
  };
@@ -254,4 +256,4 @@ declare namespace SEL {
254
256
  export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type SEL_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type SEL_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type SEL_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
255
257
  }
256
258
 
257
- export { index$1 as JsxConfig, index as LanguagePreference, RE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, SEL, createReport };
259
+ export { index$1 as JsxConfig, index as LanguagePreference, RE, Report, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, SEL };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ } from '@eslint-react/eff';
2
1
  import * as tseslint from '@typescript-eslint/utils/ts-eslint';
3
2
  import { ReportDescriptor } from '@typescript-eslint/utils/ts-eslint';
4
3
  import { CompilerOptions, JsxEmit } from 'typescript';
5
4
  import * as valibot from 'valibot';
6
5
  import { InferOutput } from 'valibot';
6
+ import { _ } from '@eslint-react/eff';
7
7
  import { TSESTree } from '@typescript-eslint/utils';
8
8
 
9
9
  /**
@@ -33,19 +33,12 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
33
33
  */
34
34
  type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
35
35
 
36
- /**
37
- * Creates a report function that can conditionally report a descriptor.
38
- * @param context - The context of the rule
39
- * @returns A function that takes a descriptor and reports it if it's not null or undefined
40
- */
41
- declare function createReport<MessageID extends string>(context: RuleContext): (descriptor: _ | null | ReportDescriptor<MessageID>) => void;
42
-
43
36
  type JsxConfig = Pick<CompilerOptions, "reactNamespace" | "jsx" | "jsxFactory" | "jsxFragmentFactory" | "jsxImportSource">;
44
37
  /**
45
38
  * Create a JsxConfig object
46
39
  * @returns JsxConfig
47
40
  */
48
- declare function make$1(): JsxConfig;
41
+ declare function make$2(): JsxConfig;
49
42
  /**
50
43
  * Get JsxConfig from RuleContext
51
44
  * @param context The RuleContext
@@ -68,7 +61,7 @@ declare function getFromAnnotation(context: RuleContext): JsxConfig;
68
61
  type index$1_JsxConfig = JsxConfig;
69
62
  declare const index$1_getFromAnnotation: typeof getFromAnnotation;
70
63
  declare namespace index$1 {
71
- export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$1 as make };
64
+ export { type index$1_JsxConfig as JsxConfig, index$1_getFromAnnotation as getFromAnnotation, getFromContext$1 as getFromContext, make$2 as make };
72
65
  }
73
66
 
74
67
  /**
@@ -101,7 +94,7 @@ declare const DEFAULT_LANGUAGE_PREFERENCE: {
101
94
  /**
102
95
  * Get a copy of the default LanguagePreference.
103
96
  */
104
- declare function make(): LanguagePreference;
97
+ declare function make$1(): LanguagePreference;
105
98
  declare function getFromContext(): void;
106
99
  declare module "@typescript-eslint/utils/ts-eslint" {
107
100
  interface SharedConfigurationSettings {
@@ -112,9 +105,8 @@ declare const index_DEFAULT_LANGUAGE_PREFERENCE: typeof DEFAULT_LANGUAGE_PREFERE
112
105
  type index_LanguagePreference = LanguagePreference;
113
106
  declare const index_LanguagePreferenceSchema: typeof LanguagePreferenceSchema;
114
107
  declare const index_getFromContext: typeof getFromContext;
115
- declare const index_make: typeof make;
116
108
  declare namespace index {
117
- export { index_DEFAULT_LANGUAGE_PREFERENCE as DEFAULT_LANGUAGE_PREFERENCE, type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_getFromContext as getFromContext, index_make as make };
109
+ export { index_DEFAULT_LANGUAGE_PREFERENCE as DEFAULT_LANGUAGE_PREFERENCE, type index_LanguagePreference as LanguagePreference, index_LanguagePreferenceSchema as LanguagePreferenceSchema, index_getFromContext as getFromContext, make$1 as make };
118
110
  }
119
111
 
120
112
  /**
@@ -223,6 +215,16 @@ declare namespace RE {
223
215
  export { RE_ANNOTATION_JSX as ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG as ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE as ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME as ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE as CAMEL_CASE, RE_COMPONENT_NAME as COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE as COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE as CONSTANT_CASE, RE_HOOK_NAME as HOOK_NAME, RE_JAVASCRIPT_PROTOCOL as JAVASCRIPT_PROTOCOL, RE_JS_EXT as JS_EXT, RE_JS_IDENTIFIER as JS_IDENTIFIER, RE_KEBAB_CASE as KEBAB_CASE, RE_PASCAL_CASE as PASCAL_CASE, RE_REGEXP_STR as REGEXP_STR, RE_SNAKE_CASE as SNAKE_CASE, RE_TS_EXT as TS_EXT, RE_isRegExp as isRegExp, RE_toRegExp as toRegExp };
224
216
  }
225
217
 
218
+ declare function make<TMessageID extends string>(context: RuleContext<TMessageID>): {
219
+ readonly send: (descriptor: _ | null | ReportDescriptor<TMessageID>) => void;
220
+ readonly sendOrElse: <TElse>(descriptor: _ | null | ReportDescriptor<TMessageID>, fallback: () => TElse) => void | TElse;
221
+ };
222
+
223
+ declare const Report_make: typeof make;
224
+ declare namespace Report {
225
+ export { Report_make as make };
226
+ }
227
+
226
228
  type ImplicitReturnArrowFunctionExpression = TSESTree.ArrowFunctionExpression & {
227
229
  body: TSESTree.Expression;
228
230
  };
@@ -254,4 +256,4 @@ declare namespace SEL {
254
256
  export { SEL_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type SEL_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, SEL_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type SEL_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, SEL_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type SEL_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
255
257
  }
256
258
 
257
- export { index$1 as JsxConfig, index as LanguagePreference, RE, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, SEL, createReport };
259
+ export { index$1 as JsxConfig, index as LanguagePreference, RE, Report, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, SEL };
package/dist/index.js CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  var typescript = require('typescript');
4
4
  var valibot = require('valibot');
5
+ require('@eslint-react/eff');
5
6
 
6
7
  var __defProp = Object.defineProperty;
7
8
  var __export = (target, all) => {
@@ -9,13 +10,6 @@ var __export = (target, all) => {
9
10
  __defProp(target, name, { get: all[name], enumerable: true });
10
11
  };
11
12
 
12
- // src/helpers.ts
13
- function createReport(context) {
14
- return (descriptor) => {
15
- if (descriptor != null) context.report(descriptor);
16
- };
17
- }
18
-
19
13
  // src/JsxConfig/index.ts
20
14
  var JsxConfig_exports = {};
21
15
  __export(JsxConfig_exports, {
@@ -170,6 +164,24 @@ var LanguagePreferenceSchema = valibot.object({
170
164
  )
171
165
  });
172
166
 
167
+ // src/Report.ts
168
+ var Report_exports = {};
169
+ __export(Report_exports, {
170
+ make: () => make3
171
+ });
172
+ function make3(context) {
173
+ return {
174
+ send(descriptor) {
175
+ if (descriptor == null) return;
176
+ return context.report(descriptor);
177
+ },
178
+ sendOrElse(descriptor, fallback) {
179
+ if (descriptor == null) return fallback();
180
+ return context.report(descriptor);
181
+ }
182
+ };
183
+ }
184
+
173
185
  // src/SEL.ts
174
186
  var SEL_exports = {};
175
187
  __export(SEL_exports, {
@@ -193,5 +205,5 @@ var DISPLAY_NAME_ASSIGNMENT_EXPRESSION = [
193
205
  exports.JsxConfig = JsxConfig_exports;
194
206
  exports.LanguagePreference = LanguagePreference_exports;
195
207
  exports.RE = RE_exports;
208
+ exports.Report = Report_exports;
196
209
  exports.SEL = SEL_exports;
197
- exports.createReport = createReport;
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { JsxEmit } from 'typescript';
2
2
  import { object, optional, union, literal, number } from 'valibot';
3
+ import '@eslint-react/eff';
3
4
 
4
5
  var __defProp = Object.defineProperty;
5
6
  var __export = (target, all) => {
@@ -7,13 +8,6 @@ var __export = (target, all) => {
7
8
  __defProp(target, name, { get: all[name], enumerable: true });
8
9
  };
9
10
 
10
- // src/helpers.ts
11
- function createReport(context) {
12
- return (descriptor) => {
13
- if (descriptor != null) context.report(descriptor);
14
- };
15
- }
16
-
17
11
  // src/JsxConfig/index.ts
18
12
  var JsxConfig_exports = {};
19
13
  __export(JsxConfig_exports, {
@@ -168,6 +162,24 @@ var LanguagePreferenceSchema = object({
168
162
  )
169
163
  });
170
164
 
165
+ // src/Report.ts
166
+ var Report_exports = {};
167
+ __export(Report_exports, {
168
+ make: () => make3
169
+ });
170
+ function make3(context) {
171
+ return {
172
+ send(descriptor) {
173
+ if (descriptor == null) return;
174
+ return context.report(descriptor);
175
+ },
176
+ sendOrElse(descriptor, fallback) {
177
+ if (descriptor == null) return fallback();
178
+ return context.report(descriptor);
179
+ }
180
+ };
181
+ }
182
+
171
183
  // src/SEL.ts
172
184
  var SEL_exports = {};
173
185
  __export(SEL_exports, {
@@ -188,4 +200,4 @@ var DISPLAY_NAME_ASSIGNMENT_EXPRESSION = [
188
200
  "[left.property.name='displayName']"
189
201
  ].join("");
190
202
 
191
- export { JsxConfig_exports as JsxConfig, LanguagePreference_exports as LanguagePreference, RE_exports as RE, SEL_exports as SEL, createReport };
203
+ export { JsxConfig_exports as JsxConfig, LanguagePreference_exports as LanguagePreference, RE_exports as RE, Report_exports as Report, SEL_exports as SEL };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/kit",
3
- "version": "1.45.4-next.1",
3
+ "version": "1.45.4-next.2",
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": {
@@ -38,7 +38,7 @@
38
38
  "@typescript-eslint/utils": "^8.29.1",
39
39
  "ts-pattern": "^5.7.0",
40
40
  "valibot": "^1.0.0",
41
- "@eslint-react/eff": "1.45.4-next.1"
41
+ "@eslint-react/eff": "1.45.4-next.2"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@tsconfig/node22": "^22.0.1",