@eslint-react/kit 1.52.9-next.0 → 1.52.10-beta.0

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
@@ -9,18 +9,25 @@ import { TSESTree } from '@typescript-eslint/utils';
9
9
  * Rule severity.
10
10
  * @since 0.0.1
11
11
  */
12
- type RuleSeverity = "error" | "off" | "warn";
12
+ type SeverityName = "off" | "warn" | "error";
13
13
  /**
14
- * Rule declaration.
15
- * @internal
16
- * @since 0.0.1
14
+ * The numeric severity level for a rule.
15
+ *
16
+ * - `0` means off.
17
+ * - `1` means warn.
18
+ * - `2` means error.
19
+ */
20
+ type SeverityLevel = 0 | 1 | 2;
21
+ /**
22
+ * The severity of a rule in a configuration.
17
23
  */
18
- type RuleDeclaration = [RuleSeverity, Record<string, unknown>?] | RuleSeverity;
24
+ type Severity = SeverityName | SeverityLevel;
19
25
  /**
20
- * Rule config preset.
26
+ * Rule declaration.
27
+ * @internal
21
28
  * @since 0.0.1
22
29
  */
23
- type RulePreset = Record<string, RuleDeclaration>;
30
+ type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
24
31
  /**
25
32
  * Rule context.
26
33
  * @since 0.0.1
@@ -31,6 +38,34 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
31
38
  * @since 1.20.0
32
39
  */
33
40
  type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
41
+ type RulePolicy = number;
42
+ type RuleSuggest<MessageIds extends string = string> = {
43
+ messageId: MessageIds;
44
+ data?: Record<string, unknown>;
45
+ fix: tseslint.ReportFixFunction;
46
+ };
47
+ /**
48
+ * A collection of settings.
49
+ */
50
+ interface SettingsConfig {
51
+ [key: string]: unknown;
52
+ }
53
+ interface CompatibleRule {
54
+ meta: Record<string, any>;
55
+ create: (...args: any[]) => any;
56
+ }
57
+ interface CompatiblePlugin {
58
+ meta: {
59
+ name: string;
60
+ version: string;
61
+ };
62
+ rules: Record<string, CompatibleRule>;
63
+ }
64
+ interface CompatibleConfig {
65
+ name?: string;
66
+ rules?: Record<string, RuleConfig>;
67
+ settings?: SettingsConfig;
68
+ }
34
69
 
35
70
  declare const JsxEmit: {
36
71
  readonly None: 0;
@@ -286,4 +321,4 @@ declare namespace Selector {
286
321
  export { Selector_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type Selector_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type Selector_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type Selector_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
287
322
  }
288
323
 
289
- export { index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, Selector };
324
+ export { type CompatibleConfig, type CompatiblePlugin, type CompatibleRule, index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleConfig, type RuleContext, type RuleFeature, type RulePolicy, type RuleSuggest, Selector, type SettingsConfig, type Severity, type SeverityLevel, type SeverityName };
package/dist/index.d.ts CHANGED
@@ -9,18 +9,25 @@ import { TSESTree } from '@typescript-eslint/utils';
9
9
  * Rule severity.
10
10
  * @since 0.0.1
11
11
  */
12
- type RuleSeverity = "error" | "off" | "warn";
12
+ type SeverityName = "off" | "warn" | "error";
13
13
  /**
14
- * Rule declaration.
15
- * @internal
16
- * @since 0.0.1
14
+ * The numeric severity level for a rule.
15
+ *
16
+ * - `0` means off.
17
+ * - `1` means warn.
18
+ * - `2` means error.
19
+ */
20
+ type SeverityLevel = 0 | 1 | 2;
21
+ /**
22
+ * The severity of a rule in a configuration.
17
23
  */
18
- type RuleDeclaration = [RuleSeverity, Record<string, unknown>?] | RuleSeverity;
24
+ type Severity = SeverityName | SeverityLevel;
19
25
  /**
20
- * Rule config preset.
26
+ * Rule declaration.
27
+ * @internal
21
28
  * @since 0.0.1
22
29
  */
23
- type RulePreset = Record<string, RuleDeclaration>;
30
+ type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
24
31
  /**
25
32
  * Rule context.
26
33
  * @since 0.0.1
@@ -31,6 +38,34 @@ type RuleContext<MessageIds extends string = string, Options extends readonly un
31
38
  * @since 1.20.0
32
39
  */
33
40
  type RuleFeature = "CFG" | "DBG" | "FIX" | "MOD" | "TSC" | "EXP";
41
+ type RulePolicy = number;
42
+ type RuleSuggest<MessageIds extends string = string> = {
43
+ messageId: MessageIds;
44
+ data?: Record<string, unknown>;
45
+ fix: tseslint.ReportFixFunction;
46
+ };
47
+ /**
48
+ * A collection of settings.
49
+ */
50
+ interface SettingsConfig {
51
+ [key: string]: unknown;
52
+ }
53
+ interface CompatibleRule {
54
+ meta: Record<string, any>;
55
+ create: (...args: any[]) => any;
56
+ }
57
+ interface CompatiblePlugin {
58
+ meta: {
59
+ name: string;
60
+ version: string;
61
+ };
62
+ rules: Record<string, CompatibleRule>;
63
+ }
64
+ interface CompatibleConfig {
65
+ name?: string;
66
+ rules?: Record<string, RuleConfig>;
67
+ settings?: SettingsConfig;
68
+ }
34
69
 
35
70
  declare const JsxEmit: {
36
71
  readonly None: 0;
@@ -286,4 +321,4 @@ declare namespace Selector {
286
321
  export { Selector_DISPLAY_NAME_ASSIGNMENT_EXPRESSION as DISPLAY_NAME_ASSIGNMENT_EXPRESSION, type Selector_DisplayNameAssignmentExpression as DisplayNameAssignmentExpression, Selector_IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION as IMPLICIT_RETURN_ARROW_FUNCTION_EXPRESSION, type Selector_ImplicitReturnArrowFunctionExpression as ImplicitReturnArrowFunctionExpression, Selector_OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR as OBJECT_DESTRUCTURING_VARIABLE_DECLARATOR, type Selector_ObjectDestructuringVariableDeclarator as ObjectDestructuringVariableDeclarator };
287
322
  }
288
323
 
289
- export { index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleContext, type RuleDeclaration, type RuleFeature, type RulePreset, type RuleSeverity, Selector };
324
+ export { type CompatibleConfig, type CompatiblePlugin, type CompatibleRule, index$1 as JsxConfig, index as LanguagePreference, RegExp$1 as RegExp, Reporter$1 as Reporter, type RuleConfig, type RuleContext, type RuleFeature, type RulePolicy, type RuleSuggest, Selector, type SettingsConfig, type Severity, type SeverityLevel, type SeverityName };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/kit",
3
- "version": "1.52.9-next.0",
3
+ "version": "1.52.10-beta.0",
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.41.0",
39
39
  "ts-pattern": "^5.8.0",
40
40
  "zod": "^4.1.5",
41
- "@eslint-react/eff": "1.52.9-next.0"
41
+ "@eslint-react/eff": "1.52.10-beta.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@tsconfig/node22": "^22.0.2",