@eslint-react/shared 1.12.3 → 1.12.4-beta.3

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
@@ -975,11 +975,11 @@ type HasDefault<TSchema extends QuestionMarkSchema> = [
975
975
  /**
976
976
  * Exact optional input type.
977
977
  */
978
- type ExactOptionalInput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends NullishSchema<infer TWrapped, never> | NullishSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> | null : TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> : InferInput<TSchema>;
978
+ type ExactOptionalInput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> : InferInput<TSchema>;
979
979
  /**
980
980
  * Exact optional output type.
981
981
  */
982
- type ExactOptionalOutput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends NullishSchema<infer TWrapped, never> | NullishSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> | null : TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> : InferOutput<TSchema>;
982
+ type ExactOptionalOutput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> : InferOutput<TSchema>;
983
983
  /**
984
984
  * Infer entries input type.
985
985
  */
@@ -1002,7 +1002,7 @@ type OptionalInputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1002
1002
  * Optional output keys type.
1003
1003
  */
1004
1004
  type OptionalOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1005
- [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? HasDefault<TEntries[TKey]> extends true ? never : TKey : never;
1005
+ [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? undefined extends InferOutput<TEntries[TKey]> ? HasDefault<TEntries[TKey]> extends false ? TKey : never : never : never;
1006
1006
  }[keyof TEntries];
1007
1007
  /**
1008
1008
  * Input with question marks type.
@@ -1364,7 +1364,7 @@ declare const CustomComponentSchema: ObjectSchema<{
1364
1364
  * `"/"`
1365
1365
  */
1366
1366
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1367
- }, undefined>, undefined>, readonly []>;
1367
+ }, undefined>, undefined>, never>;
1368
1368
  }, undefined>;
1369
1369
  declare const CustomComponentNormalizedSchema: ObjectSchema<{
1370
1370
  readonly name: StringSchema<undefined>;
@@ -1495,7 +1495,7 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
1495
1495
  * `"/"`
1496
1496
  */
1497
1497
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1498
- }, undefined>, undefined>, readonly []>;
1498
+ }, undefined>, undefined>, never>;
1499
1499
  }, undefined>, undefined>, never>;
1500
1500
  /**
1501
1501
  * A object of aliases for React built-in hooks.
@@ -1621,7 +1621,7 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1621
1621
  * `"/"`
1622
1622
  */
1623
1623
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1624
- }, undefined>, undefined>, readonly []>;
1624
+ }, undefined>, undefined>, never>;
1625
1625
  }, undefined>, undefined>, never>;
1626
1626
  /**
1627
1627
  * A object of aliases for React built-in hooks.
@@ -1744,7 +1744,7 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1744
1744
  * `"/"`
1745
1745
  */
1746
1746
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1747
- }, undefined>, undefined>, readonly []>;
1747
+ }, undefined>, undefined>, never>;
1748
1748
  }, undefined>, undefined>, never>;
1749
1749
  /**
1750
1750
  * A object of aliases for React built-in hooks.
@@ -2055,14 +2055,14 @@ declare const decodeSettings: Memoized<(data: unknown) => {
2055
2055
  readonly version?: string;
2056
2056
  readonly additionalComponents?: {
2057
2057
  name: string;
2058
- attributes: {
2058
+ as?: string;
2059
+ selector?: string;
2060
+ attributes?: {
2059
2061
  name: string;
2060
2062
  as?: string;
2061
2063
  controlled?: boolean;
2062
2064
  defaultValue?: string;
2063
2065
  }[];
2064
- as?: string;
2065
- selector?: string;
2066
2066
  }[];
2067
2067
  readonly additionalHooks?: {
2068
2068
  use?: string[];
@@ -2129,5 +2129,10 @@ declare function findAttrInCustomAttributes(name: string, attributes: CustomAttr
2129
2129
  * @returns The settings.
2130
2130
  */
2131
2131
  declare const defineSettings: (settings: ESLintReactSettings) => ESLintReactSettings;
2132
+ declare module "@typescript-eslint/utils/ts-eslint" {
2133
+ interface SharedConfigurationSettings {
2134
+ "react-x"?: Partial<ESLintReactSettings>;
2135
+ }
2136
+ }
2132
2137
 
2133
2138
  export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, INITIAL_ESLINT_REACT_SETTINGS, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, findAttrInCustomAttributes, normalizeSettings, unsafeReadSettings };
package/dist/index.d.ts CHANGED
@@ -975,11 +975,11 @@ type HasDefault<TSchema extends QuestionMarkSchema> = [
975
975
  /**
976
976
  * Exact optional input type.
977
977
  */
978
- type ExactOptionalInput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends NullishSchema<infer TWrapped, never> | NullishSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> | null : TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> : InferInput<TSchema>;
978
+ type ExactOptionalInput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? ExactOptionalInput<TWrapped> : InferInput<TSchema>;
979
979
  /**
980
980
  * Exact optional output type.
981
981
  */
982
- type ExactOptionalOutput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends NullishSchema<infer TWrapped, never> | NullishSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> | null : TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> : InferOutput<TSchema>;
982
+ type ExactOptionalOutput<TSchema extends BaseSchema<unknown, unknown, BaseIssue<unknown>> | BaseSchemaAsync<unknown, unknown, BaseIssue<unknown>>> = TSchema extends OptionalSchema<infer TWrapped, never> | OptionalSchemaAsync<infer TWrapped, never> ? HasDefault<TSchema> extends true ? InferOutput<TSchema> : ExactOptionalOutput<TWrapped> : InferOutput<TSchema>;
983
983
  /**
984
984
  * Infer entries input type.
985
985
  */
@@ -1002,7 +1002,7 @@ type OptionalInputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1002
1002
  * Optional output keys type.
1003
1003
  */
1004
1004
  type OptionalOutputKeys<TEntries extends ObjectEntries | ObjectEntriesAsync> = {
1005
- [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? HasDefault<TEntries[TKey]> extends true ? never : TKey : never;
1005
+ [TKey in keyof TEntries]: TEntries[TKey] extends QuestionMarkSchema ? undefined extends InferOutput<TEntries[TKey]> ? HasDefault<TEntries[TKey]> extends false ? TKey : never : never : never;
1006
1006
  }[keyof TEntries];
1007
1007
  /**
1008
1008
  * Input with question marks type.
@@ -1364,7 +1364,7 @@ declare const CustomComponentSchema: ObjectSchema<{
1364
1364
  * `"/"`
1365
1365
  */
1366
1366
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1367
- }, undefined>, undefined>, readonly []>;
1367
+ }, undefined>, undefined>, never>;
1368
1368
  }, undefined>;
1369
1369
  declare const CustomComponentNormalizedSchema: ObjectSchema<{
1370
1370
  readonly name: StringSchema<undefined>;
@@ -1495,7 +1495,7 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
1495
1495
  * `"/"`
1496
1496
  */
1497
1497
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1498
- }, undefined>, undefined>, readonly []>;
1498
+ }, undefined>, undefined>, never>;
1499
1499
  }, undefined>, undefined>, never>;
1500
1500
  /**
1501
1501
  * A object of aliases for React built-in hooks.
@@ -1621,7 +1621,7 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1621
1621
  * `"/"`
1622
1622
  */
1623
1623
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1624
- }, undefined>, undefined>, readonly []>;
1624
+ }, undefined>, undefined>, never>;
1625
1625
  }, undefined>, undefined>, never>;
1626
1626
  /**
1627
1627
  * A object of aliases for React built-in hooks.
@@ -1744,7 +1744,7 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1744
1744
  * `"/"`
1745
1745
  */
1746
1746
  readonly defaultValue: OptionalSchema<StringSchema<undefined>, never>;
1747
- }, undefined>, undefined>, readonly []>;
1747
+ }, undefined>, undefined>, never>;
1748
1748
  }, undefined>, undefined>, never>;
1749
1749
  /**
1750
1750
  * A object of aliases for React built-in hooks.
@@ -2055,14 +2055,14 @@ declare const decodeSettings: Memoized<(data: unknown) => {
2055
2055
  readonly version?: string;
2056
2056
  readonly additionalComponents?: {
2057
2057
  name: string;
2058
- attributes: {
2058
+ as?: string;
2059
+ selector?: string;
2060
+ attributes?: {
2059
2061
  name: string;
2060
2062
  as?: string;
2061
2063
  controlled?: boolean;
2062
2064
  defaultValue?: string;
2063
2065
  }[];
2064
- as?: string;
2065
- selector?: string;
2066
2066
  }[];
2067
2067
  readonly additionalHooks?: {
2068
2068
  use?: string[];
@@ -2129,5 +2129,10 @@ declare function findAttrInCustomAttributes(name: string, attributes: CustomAttr
2129
2129
  * @returns The settings.
2130
2130
  */
2131
2131
  declare const defineSettings: (settings: ESLintReactSettings) => ESLintReactSettings;
2132
+ declare module "@typescript-eslint/utils/ts-eslint" {
2133
+ interface SharedConfigurationSettings {
2134
+ "react-x"?: Partial<ESLintReactSettings>;
2135
+ }
2136
+ }
2132
2137
 
2133
2138
  export { type CustomAttribute, CustomAttributeSchema, type CustomComponent, type CustomComponentNormalized, CustomComponentNormalizedSchema, CustomComponentSchema, type CustomHook, CustomHookSchema, type ESLintReactSettings, type ESLintReactSettingsNormalized, ESLintReactSettingsSchema, type ESLintSettings, ESLintSettingsSchema, GITHUB_URL, HOST_HTML_COMPONENT_TYPES, HOST_SVG_COMPONENT_TYPES, INITIAL_ESLINT_REACT_SETTINGS, NPM_SCOPE, REACT_BUILD_IN_HOOKS, RE_CAMEL_CASE, RE_CONSTANT_CASE, RE_JAVASCRIPT_PROTOCOL, RE_KEBAB_CASE, RE_PASCAL_CASE, RE_SNAKE_CASE, WEBSITE_URL, createRuleForPlugin, decodeSettings, defineSettings, findAttrInCustomAttributes, normalizeSettings, unsafeReadSettings };
package/dist/index.js CHANGED
@@ -567,7 +567,7 @@ var CustomComponentSchema = object({
567
567
  * @example
568
568
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
569
569
  */
570
- attributes: optional(array(CustomAttributeSchema), [])
570
+ attributes: optional(array(CustomAttributeSchema))
571
571
  });
572
572
  var CustomComponentNormalizedSchema = object({
573
573
  name: string(),
@@ -1322,14 +1322,14 @@ var normalizeSettings = createMemoizedFunction((settings) => {
1322
1322
  ...settings,
1323
1323
  additionalComponents: additionalComponents.map((component) => ({
1324
1324
  ...component,
1325
- attributes: component.attributes.map((attr) => ({
1325
+ attributes: component.attributes?.map((attr) => ({
1326
1326
  ...attr,
1327
1327
  as: attr.as ?? attr.name
1328
- })),
1328
+ })) ?? [],
1329
1329
  re: pm__default.default.makeRe(component.name, { fastpaths: true })
1330
1330
  })),
1331
1331
  components: additionalComponents.reduce((acc, component) => {
1332
- const { name, as, attributes, selector } = component;
1332
+ const { name, as, attributes = [], selector } = component;
1333
1333
  if (!name || !as || selector || attributes.length > 0) return acc;
1334
1334
  if (!/^[\w-]+$/u.test(name)) return acc;
1335
1335
  return acc.set(name, as);
package/dist/index.mjs CHANGED
@@ -561,7 +561,7 @@ var CustomComponentSchema = object({
561
561
  * @example
562
562
  * `Link` component has a `to` attribute that represents the `href` attribute in the built-in `a` element with a default value of `"/"`.
563
563
  */
564
- attributes: optional(array(CustomAttributeSchema), [])
564
+ attributes: optional(array(CustomAttributeSchema))
565
565
  });
566
566
  var CustomComponentNormalizedSchema = object({
567
567
  name: string(),
@@ -1316,14 +1316,14 @@ var normalizeSettings = createMemoizedFunction((settings) => {
1316
1316
  ...settings,
1317
1317
  additionalComponents: additionalComponents.map((component) => ({
1318
1318
  ...component,
1319
- attributes: component.attributes.map((attr) => ({
1319
+ attributes: component.attributes?.map((attr) => ({
1320
1320
  ...attr,
1321
1321
  as: attr.as ?? attr.name
1322
- })),
1322
+ })) ?? [],
1323
1323
  re: pm.makeRe(component.name, { fastpaths: true })
1324
1324
  })),
1325
1325
  components: additionalComponents.reduce((acc, component) => {
1326
- const { name, as, attributes, selector } = component;
1326
+ const { name, as, attributes = [], selector } = component;
1327
1327
  if (!name || !as || selector || attributes.length > 0) return acc;
1328
1328
  if (!/^[\w-]+$/u.test(name)) return acc;
1329
1329
  return acc.set(name, as);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.12.3",
3
+ "version": "1.12.4-beta.3",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/rel1cx/eslint-react",
6
6
  "bugs": {
@@ -37,7 +37,7 @@
37
37
  "dependencies": {
38
38
  "@typescript-eslint/utils": "^8.3.0",
39
39
  "picomatch": "^4.0.2",
40
- "@eslint-react/tools": "1.12.3"
40
+ "@eslint-react/tools": "1.12.4-beta.3"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/picomatch": "^3.0.1",
@@ -45,7 +45,7 @@
45
45
  "micro-memoize": "^4.1.2",
46
46
  "tsup": "^8.2.4",
47
47
  "type-fest": "^4.26.0",
48
- "valibot": "^0.39.0"
48
+ "valibot": "^0.40.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsup --dts-resolve",