@eslint-react/shared 5.18.7 → 5.18.9

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +36 -37
  2. package/package.json +5 -5
package/dist/index.d.ts CHANGED
@@ -2,46 +2,46 @@ import { z } from "zod/v4";
2
2
  import { RuleContext } from "@eslint-react/eslint";
3
3
  //#region src/regexp.d.ts
4
4
  /** Regular expression for matching an HTML tag name. */
5
- declare const RE_HTML_TAG: RegExp;
5
+ export declare const RE_HTML_TAG: RegExp;
6
6
  /** Regular expression for matching a TypeScript file extension. */
7
- declare const RE_TS_EXT: RegExp;
7
+ export declare const RE_TS_EXT: RegExp;
8
8
  /** Regular expression for matching a JavaScript file extension. */
9
- declare const RE_JS_EXT: RegExp;
9
+ export declare const RE_JS_EXT: RegExp;
10
10
  /** Regular expression for matching a PascalCase string. */
11
- declare const RE_PASCAL_CASE: RegExp;
11
+ export declare const RE_PASCAL_CASE: RegExp;
12
12
  /** Regular expression for matching a camelCase string. */
13
- declare const RE_CAMEL_CASE: RegExp;
13
+ export declare const RE_CAMEL_CASE: RegExp;
14
14
  /** Regular expression for matching a kebab-case string. */
15
- declare const RE_KEBAB_CASE: RegExp;
15
+ export declare const RE_KEBAB_CASE: RegExp;
16
16
  /** Regular expression for matching a snake_case string. */
17
- declare const RE_SNAKE_CASE: RegExp;
17
+ export declare const RE_SNAKE_CASE: RegExp;
18
18
  /** Regular expression for matching a CONSTANT_CASE string. */
19
- declare const RE_CONSTANT_CASE: RegExp;
19
+ export declare const RE_CONSTANT_CASE: RegExp;
20
20
  /**
21
21
  * Regular expression for matching the `javascript:` protocol.
22
22
  * @see https://github.com/facebook/react/blob/6db7f4209e6f32ebde298a0b7451710dd6aa3e19/packages/react-dom-bindings/src/shared/sanitizeURL.js#L22
23
23
  */
24
- declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
24
+ export declare const RE_JAVASCRIPT_PROTOCOL: RegExp;
25
25
  /** Regular expression for matching a valid JavaScript identifier. */
26
- declare const RE_JS_IDENTIFIER: RegExp;
26
+ export declare const RE_JS_IDENTIFIER: RegExp;
27
27
  /** Regular expression for matching a RegExp string. */
28
- declare const RE_REGEXP_STR: RegExp;
28
+ export declare const RE_REGEXP_STR: RegExp;
29
29
  /** Regular expression for matching a `@jsx` annotation comment. */
30
- declare const RE_ANNOTATION_JSX: RegExp;
30
+ export declare const RE_ANNOTATION_JSX: RegExp;
31
31
  /** Regular expression for matching a `@jsxFrag` annotation comment. */
32
- declare const RE_ANNOTATION_JSX_FRAG: RegExp;
32
+ export declare const RE_ANNOTATION_JSX_FRAG: RegExp;
33
33
  /** Regular expression for matching a `@jsxRuntime` annotation comment. */
34
- declare const RE_ANNOTATION_JSX_RUNTIME: RegExp;
34
+ export declare const RE_ANNOTATION_JSX_RUNTIME: RegExp;
35
35
  /** Regular expression for matching a `@jsxImportSource` annotation comment. */
36
- declare const RE_ANNOTATION_JSX_IMPORT_SOURCE: RegExp;
36
+ export declare const RE_ANNOTATION_JSX_IMPORT_SOURCE: RegExp;
37
37
  /** Regular expression for matching a React component name. */
38
- declare const RE_COMPONENT_NAME: RegExp;
38
+ export declare const RE_COMPONENT_NAME: RegExp;
39
39
  /** Regular expression for matching a React component name (loose). */
40
- declare const RE_COMPONENT_NAME_LOOSE: RegExp;
40
+ export declare const RE_COMPONENT_NAME_LOOSE: RegExp;
41
41
  /** Regular expression for matching a React Hook name. */
42
- declare const RE_HOOK_NAME: RegExp;
42
+ export declare const RE_HOOK_NAME: RegExp;
43
43
  /** Represents a RegExp-like object with a `test` method. */
44
- type RegExpLike = {
44
+ export type RegExpLike = {
45
45
  test: (s: string) => boolean;
46
46
  };
47
47
  /**
@@ -53,20 +53,20 @@ type RegExpLike = {
53
53
  * @returns The converted `RegExpLike` object.
54
54
  * @see https://github.com/sveltejs/eslint-plugin-svelte/blob/main/packages/eslint-plugin-svelte/src/utils/regexp.ts
55
55
  */
56
- declare function toRegExp(string: string | null | undefined): RegExpLike;
56
+ export declare function toRegExp(string: string | null | undefined): RegExpLike;
57
57
  /**
58
58
  * Check if the string is a RegExp string.
59
59
  * @param string The string to check.
60
60
  * @returns `true` if the string is a RegExp string.
61
61
  */
62
- declare function isRegExp(string: string): boolean;
62
+ export declare function isRegExp(string: string): boolean;
63
63
  //#endregion
64
64
  //#region src/settings.d.ts
65
65
  /**
66
66
  * The zod schema for the ESLint React settings.
67
67
  * @internal
68
68
  */
69
- declare const ESLintReactSettingsSchema: z.ZodObject<{
69
+ export declare const ESLintReactSettingsSchema: z.ZodObject<{
70
70
  importSource: z.ZodOptional<z.ZodString>;
71
71
  compilationMode: z.ZodOptional<z.ZodEnum<{
72
72
  infer: "infer";
@@ -84,15 +84,15 @@ declare const ESLintReactSettingsSchema: z.ZodObject<{
84
84
  * The zod schema for the ESLint settings.
85
85
  * @internal
86
86
  */
87
- declare const ESLintSettingsSchema: z.ZodOptional<z.ZodObject<{
87
+ export declare const ESLintSettingsSchema: z.ZodOptional<z.ZodObject<{
88
88
  "react-x": z.ZodOptional<z.ZodUnknown>;
89
89
  }, z.core.$strip>>;
90
90
  /** The ESLint settings inferred from `ESLintSettingsSchema`. */
91
- type ESLintSettings = z.infer<typeof ESLintSettingsSchema>;
91
+ export type ESLintSettings = z.infer<typeof ESLintSettingsSchema>;
92
92
  /** The ESLint React settings inferred from `ESLintReactSettingsSchema`. */
93
- type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>;
93
+ export type ESLintReactSettings = z.infer<typeof ESLintReactSettingsSchema>;
94
94
  /** Represents the normalized ESLint React settings used by rules. */
95
- interface ESLintReactSettingsNormalized {
95
+ export interface ESLintReactSettingsNormalized {
96
96
  /** The React version. */
97
97
  version: string;
98
98
  /** The source where React is imported from. */
@@ -109,13 +109,13 @@ interface ESLintReactSettingsNormalized {
109
109
  additionalEffectHooks: RegExpLike;
110
110
  }
111
111
  /** The default ESLint React settings. */
112
- declare const DEFAULT_ESLINT_REACT_SETTINGS: {
112
+ export declare const DEFAULT_ESLINT_REACT_SETTINGS: {
113
113
  readonly version: "detect";
114
114
  readonly importSource: "react";
115
115
  readonly polymorphicPropName: "as";
116
116
  };
117
117
  /** The default ESLint settings. */
118
- declare const DEFAULT_ESLINT_SETTINGS: {
118
+ export declare const DEFAULT_ESLINT_SETTINGS: {
119
119
  readonly "react-x": {
120
120
  readonly version: "detect";
121
121
  readonly importSource: "react";
@@ -127,31 +127,31 @@ declare const DEFAULT_ESLINT_SETTINGS: {
127
127
  * @param settings The value to check.
128
128
  * @returns `true` if the value is valid ESLint settings.
129
129
  */
130
- declare function isESLintSettings(settings: unknown): settings is ESLintSettings;
130
+ export declare function isESLintSettings(settings: unknown): settings is ESLintSettings;
131
131
  /**
132
132
  * Check if the value is valid ESLint React settings.
133
133
  * @param settings The value to check.
134
134
  * @returns `true` if the value is valid ESLint React settings.
135
135
  */
136
- declare function isESLintReactSettings(settings: unknown): settings is ESLintReactSettings;
136
+ export declare function isESLintReactSettings(settings: unknown): settings is ESLintReactSettings;
137
137
  /**
138
138
  * Decode the ESLint settings, falling back to the defaults when invalid.
139
139
  * @param settings The value to decode.
140
140
  * @returns The decoded ESLint settings.
141
141
  */
142
- declare const decodeESLintSettings: (settings: unknown) => ESLintSettings;
142
+ export declare const decodeESLintSettings: (settings: unknown) => ESLintSettings;
143
143
  /**
144
144
  * Decode the ESLint React settings, falling back to the defaults when invalid.
145
145
  * @param settings The value to decode.
146
146
  * @returns The decoded ESLint React settings.
147
147
  */
148
- declare const decodeSettings: (settings: unknown) => ESLintReactSettings;
148
+ export declare const decodeSettings: (settings: unknown) => ESLintReactSettings;
149
149
  /**
150
150
  * Normalize the ESLint React settings to the form used by rules.
151
151
  * @param settings The ESLint React settings to normalize.
152
152
  * @returns The normalized ESLint React settings.
153
153
  */
154
- declare const normalizeSettings: ({ importSource, compilationMode, polymorphicPropName, version, additionalRefHooks, additionalStateHooks, additionalEffectHooks, ...rest }: ESLintReactSettings) => {
154
+ export declare const normalizeSettings: ({ importSource, compilationMode, polymorphicPropName, version, additionalRefHooks, additionalStateHooks, additionalEffectHooks, ...rest }: ESLintReactSettings) => {
155
155
  readonly importSource: string;
156
156
  readonly compilationMode: "infer" | "annotation" | "syntax" | "all" | "off";
157
157
  readonly polymorphicPropName: string;
@@ -165,17 +165,16 @@ declare const normalizeSettings: ({ importSource, compilationMode, polymorphicPr
165
165
  * @param fallback The fallback version to return if React is not found.
166
166
  * @returns The detected React version or the fallback version.
167
167
  */
168
- declare function getReactVersion(fallback: string): string;
168
+ export declare function getReactVersion(fallback: string): string;
169
169
  /**
170
170
  * Get the normalized ESLint React settings from the rule context.
171
171
  * @param context The rule context.
172
172
  * @returns The normalized ESLint React settings.
173
173
  */
174
- declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized;
174
+ export declare function getSettingsFromContext(context: RuleContext): ESLintReactSettingsNormalized;
175
175
  declare module "@typescript-eslint/utils/ts-eslint" {
176
176
  interface SharedConfigurationSettings {
177
177
  ["react-x"]?: Partial<ESLintReactSettings>;
178
178
  }
179
179
  }
180
- //#endregion
181
- export { DEFAULT_ESLINT_REACT_SETTINGS, DEFAULT_ESLINT_SETTINGS, ESLintReactSettings, ESLintReactSettingsNormalized, ESLintReactSettingsSchema, ESLintSettings, ESLintSettingsSchema, RE_ANNOTATION_JSX, RE_ANNOTATION_JSX_FRAG, RE_ANNOTATION_JSX_IMPORT_SOURCE, RE_ANNOTATION_JSX_RUNTIME, RE_CAMEL_CASE, RE_COMPONENT_NAME, RE_COMPONENT_NAME_LOOSE, RE_CONSTANT_CASE, RE_HOOK_NAME, RE_HTML_TAG, RE_JAVASCRIPT_PROTOCOL, RE_JS_EXT, RE_JS_IDENTIFIER, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_REGEXP_STR, RE_SNAKE_CASE, RE_TS_EXT, RegExpLike, decodeESLintSettings, decodeSettings, getReactVersion, getSettingsFromContext, isESLintReactSettings, isESLintSettings, isRegExp, normalizeSettings, toRegExp };
180
+ //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "5.18.7",
3
+ "version": "5.18.9",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@eslint-react/eslint": "5.18.7",
32
+ "@eslint-react/eslint": "5.18.9",
33
33
  "@typescript-eslint/utils": "^8.69.0",
34
34
  "ts-pattern": "^5.9.0",
35
35
  "zod": "^3.25.0 || ^4.0.0"
@@ -38,10 +38,10 @@
38
38
  "@local/configs": "0.0.0",
39
39
  "@local/eff": "0.0.0",
40
40
  "@tsconfig/node24": "^24.0.5",
41
- "@types/node": "^26.4.0",
41
+ "@types/node": "^26.4.1",
42
42
  "@types/picomatch": "^4.0.3",
43
- "eslint": "^10.9.1",
44
- "tsdown": "^0.22.14",
43
+ "eslint": "^10.10.0",
44
+ "tsdown": "^0.23.0",
45
45
  "typescript": "6.0.3"
46
46
  },
47
47
  "peerDependencies": {