@eslint-react/shared 1.5.19-next.0 → 1.5.19

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
@@ -72,6 +72,35 @@ type ESLintReactSettings = ReadonlyDeep<InferOutput<typeof ESLintReactSettingsSc
72
72
  * @internal
73
73
  */
74
74
  declare const ESLintSettingsSchema: valibot.ObjectSchema<{
75
+ readonly "react-x": valibot.OptionalSchema<valibot.ObjectSchema<{
76
+ readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
77
+ readonly use: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
78
+ readonly useCallback: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
79
+ readonly useContext: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
80
+ readonly useDebugValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
81
+ readonly useDeferredValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
82
+ readonly useEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
83
+ readonly useId: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
84
+ readonly useImperativeHandle: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
85
+ readonly useInsertionEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
86
+ readonly useLayoutEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
87
+ readonly useMemo: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
88
+ readonly useOptimistic: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
89
+ readonly useReducer: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
90
+ readonly useRef: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
91
+ readonly useState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
92
+ readonly useSyncExternalStore: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
93
+ readonly useTransition: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
94
+ }, undefined>, never>;
95
+ readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
96
+ readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
97
+ readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
98
+ readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
99
+ readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
100
+ }, undefined>, never>;
101
+ /**
102
+ * @deprecated
103
+ */
75
104
  readonly reactOptions: valibot.OptionalSchema<valibot.ObjectSchema<{
76
105
  readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
77
106
  readonly use: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
@@ -99,9 +128,7 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
99
128
  readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
100
129
  }, undefined>, never>;
101
130
  }, undefined>;
102
- type ESLintSettings = ReadonlyDeep<{
103
- [key: string]: unknown;
104
- reactOptions?: ESLintReactSettings;
105
- }>;
131
+ type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
132
+ declare function getESLintReactSettings(data: unknown): ESLintReactSettings;
106
133
 
107
- export { type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin };
134
+ export { type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
package/dist/index.d.ts CHANGED
@@ -72,6 +72,35 @@ type ESLintReactSettings = ReadonlyDeep<InferOutput<typeof ESLintReactSettingsSc
72
72
  * @internal
73
73
  */
74
74
  declare const ESLintSettingsSchema: valibot.ObjectSchema<{
75
+ readonly "react-x": valibot.OptionalSchema<valibot.ObjectSchema<{
76
+ readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
77
+ readonly use: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
78
+ readonly useCallback: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
79
+ readonly useContext: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
80
+ readonly useDebugValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
81
+ readonly useDeferredValue: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
82
+ readonly useEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
83
+ readonly useId: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
84
+ readonly useImperativeHandle: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
85
+ readonly useInsertionEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
86
+ readonly useLayoutEffect: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
87
+ readonly useMemo: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
88
+ readonly useOptimistic: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
89
+ readonly useReducer: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
90
+ readonly useRef: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
91
+ readonly useState: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
92
+ readonly useSyncExternalStore: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
93
+ readonly useTransition: valibot.OptionalSchema<valibot.ArraySchema<valibot.StringSchema<undefined>, undefined>, never>;
94
+ }, undefined>, never>;
95
+ readonly importSource: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
96
+ readonly jsxPragma: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
97
+ readonly jsxPragmaFrag: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
98
+ readonly strict: valibot.OptionalSchema<valibot.BooleanSchema<undefined>, never>;
99
+ readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
100
+ }, undefined>, never>;
101
+ /**
102
+ * @deprecated
103
+ */
75
104
  readonly reactOptions: valibot.OptionalSchema<valibot.ObjectSchema<{
76
105
  readonly additionalHooks: valibot.OptionalSchema<valibot.ObjectSchema<{
77
106
  readonly use: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
@@ -99,9 +128,7 @@ declare const ESLintSettingsSchema: valibot.ObjectSchema<{
99
128
  readonly version: valibot.OptionalSchema<valibot.StringSchema<undefined>, never>;
100
129
  }, undefined>, never>;
101
130
  }, undefined>;
102
- type ESLintSettings = ReadonlyDeep<{
103
- [key: string]: unknown;
104
- reactOptions?: ESLintReactSettings;
105
- }>;
131
+ type ESLintSettings = ReadonlyDeep<InferOutput<typeof ESLintSettingsSchema>>;
132
+ declare function getESLintReactSettings(data: unknown): ESLintReactSettings;
106
133
 
107
- export { type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin };
134
+ export { type ESLintReactSettings, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
package/dist/index.js CHANGED
@@ -216,8 +216,16 @@ var ESLintReactSettingsSchema = valibot.object({
216
216
  version: valibot.optional(valibot.string())
217
217
  });
218
218
  var ESLintSettingsSchema = valibot.object({
219
+ "react-x": valibot.optional(ESLintReactSettingsSchema),
220
+ /**
221
+ * @deprecated
222
+ */
219
223
  reactOptions: valibot.optional(ESLintReactSettingsSchema)
220
224
  });
225
+ function getESLintReactSettings(data) {
226
+ const settings = valibot.parse(ESLintSettingsSchema, data);
227
+ return settings["react-x"] ?? settings.reactOptions ?? {};
228
+ }
221
229
 
222
230
  exports.ESLintReactSettingsSchema = ESLintReactSettingsSchema;
223
231
  exports.ESLintSettingsSchema = ESLintSettingsSchema;
@@ -233,3 +241,4 @@ exports.RE_PASCAL_CASE = RE_PASCAL_CASE;
233
241
  exports.RE_SNAKE_CASE = RE_SNAKE_CASE;
234
242
  exports.WEBSITE_URL = WEBSITE_URL;
235
243
  exports.createRuleForPlugin = createRuleForPlugin;
244
+ exports.getESLintReactSettings = getESLintReactSettings;
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
- import { object, optional, string, array, boolean } from 'valibot';
2
+ import { object, optional, string, array, boolean, parse } from 'valibot';
3
3
 
4
4
  // src/constants.ts
5
5
  var NPM_SCOPE = "@eslint-react";
@@ -214,7 +214,15 @@ var ESLintReactSettingsSchema = object({
214
214
  version: optional(string())
215
215
  });
216
216
  var ESLintSettingsSchema = object({
217
+ "react-x": optional(ESLintReactSettingsSchema),
218
+ /**
219
+ * @deprecated
220
+ */
217
221
  reactOptions: optional(ESLintReactSettingsSchema)
218
222
  });
223
+ function getESLintReactSettings(data) {
224
+ const settings = parse(ESLintSettingsSchema, data);
225
+ return settings["react-x"] ?? settings.reactOptions ?? {};
226
+ }
219
227
 
220
- export { ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin };
228
+ export { ESLintReactSettingsSchema, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, NPM_SCOPE, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, getESLintReactSettings };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.5.19-next.0",
3
+ "version": "1.5.19",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {