@eslint-react/shared 1.28.0-beta.1 → 1.28.0-beta.6

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
@@ -1433,10 +1433,14 @@ declare function string(): StringSchema<undefined>;
1433
1433
  */
1434
1434
  declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
1435
1435
 
1436
+ /**
1437
+ * Readonly output type.
1438
+ */
1439
+ type ReadonlyOutput<TInput> = TInput extends Map<infer TKey, infer TValue> ? ReadonlyMap<TKey, TValue> : TInput extends Set<infer TValue> ? ReadonlySet<TValue> : Readonly<TInput>;
1436
1440
  /**
1437
1441
  * Readonly action interface.
1438
1442
  */
1439
- interface ReadonlyAction<TInput> extends BaseTransformation<TInput, Readonly<TInput>, never> {
1443
+ interface ReadonlyAction<TInput> extends BaseTransformation<TInput, ReadonlyOutput<TInput>, never> {
1440
1444
  /**
1441
1445
  * The action type.
1442
1446
  */
@@ -1593,11 +1597,11 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
1593
1597
  */
1594
1598
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1595
1599
  /**
1596
- * Check both the shape and the import to determine if a API is from React.
1600
+ * Check both the shape and the import to determine if an API is from React.
1597
1601
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1598
- * @default `false`
1602
+ * @default `true`
1599
1603
  */
1600
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1604
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1601
1605
  /**
1602
1606
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1603
1607
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1725,11 +1729,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1725
1729
  */
1726
1730
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1727
1731
  /**
1728
- * Check both the shape and the import to determine if a API is from React.
1732
+ * Check both the shape and the import to determine if an API is from React.
1729
1733
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1730
- * @default `false`
1734
+ * @default `true`
1731
1735
  */
1732
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1736
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1733
1737
  /**
1734
1738
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1735
1739
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1854,11 +1858,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1854
1858
  */
1855
1859
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1856
1860
  /**
1857
- * Check both the shape and the import to determine if a API is from React.
1861
+ * Check both the shape and the import to determine if an API is from React.
1858
1862
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1859
- * @default `false`
1863
+ * @default `true`
1860
1864
  */
1861
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1865
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1862
1866
  /**
1863
1867
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1864
1868
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1964,8 +1968,8 @@ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
1964
1968
  readonly jsxPragma: "createElement";
1965
1969
  readonly jsxPragmaFrag: "Fragment";
1966
1970
  readonly polymorphicPropName: "as";
1971
+ readonly skipImportCheck: true;
1967
1972
  readonly strict: false;
1968
- readonly strictImportCheck: false;
1969
1973
  readonly version: "detect";
1970
1974
  readonly additionalHooks: {
1971
1975
  readonly useEffect: ["useIsomorphicLayoutEffect"];
@@ -2270,7 +2274,7 @@ interface ESLintReactSettingsNormalized {
2270
2274
  additionalHooks: CustomHooks;
2271
2275
  importSource: string;
2272
2276
  polymorphicPropName: string | _;
2273
- strictImportCheck: boolean;
2277
+ skipImportCheck: boolean;
2274
2278
  version: string;
2275
2279
  }
2276
2280
  /**
@@ -2293,7 +2297,7 @@ declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
2293
2297
  * @returns The normalized settings.
2294
2298
  * @internal
2295
2299
  */
2296
- declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2300
+ declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, skipImportCheck, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2297
2301
  declare function getSettingsFromContext(context: {
2298
2302
  settings: unknown;
2299
2303
  }): ESLintReactSettingsNormalized;
package/dist/index.d.ts CHANGED
@@ -1433,10 +1433,14 @@ declare function string(): StringSchema<undefined>;
1433
1433
  */
1434
1434
  declare function string<const TMessage extends ErrorMessage<StringIssue> | undefined>(message: TMessage): StringSchema<TMessage>;
1435
1435
 
1436
+ /**
1437
+ * Readonly output type.
1438
+ */
1439
+ type ReadonlyOutput<TInput> = TInput extends Map<infer TKey, infer TValue> ? ReadonlyMap<TKey, TValue> : TInput extends Set<infer TValue> ? ReadonlySet<TValue> : Readonly<TInput>;
1436
1440
  /**
1437
1441
  * Readonly action interface.
1438
1442
  */
1439
- interface ReadonlyAction<TInput> extends BaseTransformation<TInput, Readonly<TInput>, never> {
1443
+ interface ReadonlyAction<TInput> extends BaseTransformation<TInput, ReadonlyOutput<TInput>, never> {
1440
1444
  /**
1441
1445
  * The action type.
1442
1446
  */
@@ -1593,11 +1597,11 @@ declare const ESLintReactSettingsSchema: ObjectSchema<{
1593
1597
  */
1594
1598
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1595
1599
  /**
1596
- * Check both the shape and the import to determine if a API is from React.
1600
+ * Check both the shape and the import to determine if an API is from React.
1597
1601
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1598
- * @default `false`
1602
+ * @default `true`
1599
1603
  */
1600
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1604
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1601
1605
  /**
1602
1606
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1603
1607
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1725,11 +1729,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1725
1729
  */
1726
1730
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1727
1731
  /**
1728
- * Check both the shape and the import to determine if a API is from React.
1732
+ * Check both the shape and the import to determine if an API is from React.
1729
1733
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1730
- * @default `false`
1734
+ * @default `true`
1731
1735
  */
1732
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1736
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1733
1737
  /**
1734
1738
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1735
1739
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1854,11 +1858,11 @@ declare const ESLintSettingsSchema: OptionalSchema<ObjectSchema<{
1854
1858
  */
1855
1859
  readonly strict: OptionalSchema<BooleanSchema<undefined>, false>;
1856
1860
  /**
1857
- * Check both the shape and the import to determine if a API is from React.
1861
+ * Check both the shape and the import to determine if an API is from React.
1858
1862
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
1859
- * @default `false`
1863
+ * @default `true`
1860
1864
  */
1861
- readonly strictImportCheck: OptionalSchema<BooleanSchema<undefined>, false>;
1865
+ readonly skipImportCheck: OptionalSchema<BooleanSchema<undefined>, true>;
1862
1866
  /**
1863
1867
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
1864
1868
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -1964,8 +1968,8 @@ declare const DEFAULT_ESLINT_REACT_SETTINGS: {
1964
1968
  readonly jsxPragma: "createElement";
1965
1969
  readonly jsxPragmaFrag: "Fragment";
1966
1970
  readonly polymorphicPropName: "as";
1971
+ readonly skipImportCheck: true;
1967
1972
  readonly strict: false;
1968
- readonly strictImportCheck: false;
1969
1973
  readonly version: "detect";
1970
1974
  readonly additionalHooks: {
1971
1975
  readonly useEffect: ["useIsomorphicLayoutEffect"];
@@ -2270,7 +2274,7 @@ interface ESLintReactSettingsNormalized {
2270
2274
  additionalHooks: CustomHooks;
2271
2275
  importSource: string;
2272
2276
  polymorphicPropName: string | _;
2273
- strictImportCheck: boolean;
2277
+ skipImportCheck: boolean;
2274
2278
  version: string;
2275
2279
  }
2276
2280
  /**
@@ -2293,7 +2297,7 @@ declare const decodeSettings: Memoized<(data: unknown) => ESLintReactSettings>;
2293
2297
  * @returns The normalized settings.
2294
2298
  * @internal
2295
2299
  */
2296
- declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2300
+ declare const toNormalizedSettings: Memoized<({ additionalComponents, additionalHooks, importSource, polymorphicPropName, skipImportCheck, version, ...rest }: ESLintReactSettings) => ESLintReactSettingsNormalized>;
2297
2301
  declare function getSettingsFromContext(context: {
2298
2302
  settings: unknown;
2299
2303
  }): ESLintReactSettingsNormalized;
package/dist/index.js CHANGED
@@ -77,7 +77,7 @@ function getReactVersion(fallback = "19.0.0") {
77
77
  }
78
78
  }
79
79
 
80
- // ../../node_modules/.pnpm/valibot@1.0.0-rc.1_typescript@5.8.1-rc/node_modules/valibot/dist/index.js
80
+ // ../../node_modules/.pnpm/valibot@1.0.0-rc.2_typescript@5.8.1-rc/node_modules/valibot/dist/index.js
81
81
  var store;
82
82
  // @__NO_SIDE_EFFECTS__
83
83
  function getGlobalConfig(config2) {
@@ -521,11 +521,11 @@ var ESLintReactSettingsSchema = object({
521
521
  */
522
522
  strict: optional(boolean(), false),
523
523
  /**
524
- * Check both the shape and the import to determine if a API is from React.
524
+ * Check both the shape and the import to determine if an API is from React.
525
525
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
526
- * @default `false`
526
+ * @default `true`
527
527
  */
528
- strictImportCheck: optional(boolean(), false),
528
+ skipImportCheck: optional(boolean(), true),
529
529
  /**
530
530
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
531
531
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -560,8 +560,8 @@ var DEFAULT_ESLINT_REACT_SETTINGS = {
560
560
  jsxPragma: "createElement",
561
561
  jsxPragmaFrag: "Fragment",
562
562
  polymorphicPropName: "as",
563
+ skipImportCheck: true,
563
564
  strict: false,
564
- strictImportCheck: false,
565
565
  version: "detect",
566
566
  additionalHooks: {
567
567
  useEffect: ["useIsomorphicLayoutEffect"],
@@ -1277,6 +1277,7 @@ var toNormalizedSettings = createMemoizedFunction(
1277
1277
  additionalHooks = {},
1278
1278
  importSource = "react",
1279
1279
  polymorphicPropName = "as",
1280
+ skipImportCheck = true,
1280
1281
  version,
1281
1282
  ...rest
1282
1283
  }) => {
@@ -1301,6 +1302,7 @@ var toNormalizedSettings = createMemoizedFunction(
1301
1302
  additionalHooks,
1302
1303
  importSource,
1303
1304
  polymorphicPropName,
1305
+ skipImportCheck,
1304
1306
  version: tsPattern.match(version).with(tsPattern.P.union(tsPattern.P.nullish, "", "detect"), () => getReactVersion("19.0.0")).otherwise(eff.identity)
1305
1307
  };
1306
1308
  },
package/dist/index.mjs CHANGED
@@ -69,7 +69,7 @@ function getReactVersion(fallback = "19.0.0") {
69
69
  }
70
70
  }
71
71
 
72
- // ../../node_modules/.pnpm/valibot@1.0.0-rc.1_typescript@5.8.1-rc/node_modules/valibot/dist/index.js
72
+ // ../../node_modules/.pnpm/valibot@1.0.0-rc.2_typescript@5.8.1-rc/node_modules/valibot/dist/index.js
73
73
  var store;
74
74
  // @__NO_SIDE_EFFECTS__
75
75
  function getGlobalConfig(config2) {
@@ -513,11 +513,11 @@ var ESLintReactSettingsSchema = object({
513
513
  */
514
514
  strict: optional(boolean(), false),
515
515
  /**
516
- * Check both the shape and the import to determine if a API is from React.
516
+ * Check both the shape and the import to determine if an API is from React.
517
517
  * @description This can prevent false positives when using a irrelevant third-party library that has similar APIs to React.
518
- * @default `false`
518
+ * @default `true`
519
519
  */
520
- strictImportCheck: optional(boolean(), false),
520
+ skipImportCheck: optional(boolean(), true),
521
521
  /**
522
522
  * React version to use, "detect" means auto detect React version from the project’s dependencies.
523
523
  * If `importSource` is specified, an equivalent version of React should be provided here.
@@ -552,8 +552,8 @@ var DEFAULT_ESLINT_REACT_SETTINGS = {
552
552
  jsxPragma: "createElement",
553
553
  jsxPragmaFrag: "Fragment",
554
554
  polymorphicPropName: "as",
555
+ skipImportCheck: true,
555
556
  strict: false,
556
- strictImportCheck: false,
557
557
  version: "detect",
558
558
  additionalHooks: {
559
559
  useEffect: ["useIsomorphicLayoutEffect"],
@@ -1269,6 +1269,7 @@ var toNormalizedSettings = createMemoizedFunction(
1269
1269
  additionalHooks = {},
1270
1270
  importSource = "react",
1271
1271
  polymorphicPropName = "as",
1272
+ skipImportCheck = true,
1272
1273
  version,
1273
1274
  ...rest
1274
1275
  }) => {
@@ -1293,6 +1294,7 @@ var toNormalizedSettings = createMemoizedFunction(
1293
1294
  additionalHooks,
1294
1295
  importSource,
1295
1296
  polymorphicPropName,
1297
+ skipImportCheck,
1296
1298
  version: match(version).with(P.union(P.nullish, "", "detect"), () => getReactVersion("19.0.0")).otherwise(identity)
1297
1299
  };
1298
1300
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint-react/shared",
3
- "version": "1.28.0-beta.1",
3
+ "version": "1.28.0-beta.6",
4
4
  "description": "ESLint React's Shared constants and functions.",
5
5
  "homepage": "https://github.com/Rel1cx/eslint-react",
6
6
  "bugs": {
@@ -38,15 +38,15 @@
38
38
  "@typescript-eslint/utils": "^8.25.0",
39
39
  "picomatch": "^4.0.2",
40
40
  "ts-pattern": "^5.6.2",
41
- "@eslint-react/eff": "1.28.0-beta.1"
41
+ "@eslint-react/eff": "1.28.0-beta.6"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/picomatch": "^3.0.2",
45
45
  "fast-equals": "^5.2.2",
46
46
  "micro-memoize": "^4.1.3",
47
- "tsup": "^8.3.6",
47
+ "tsup": "^8.4.0",
48
48
  "type-fest": "^4.35.0",
49
- "valibot": "^1.0.0-rc.1",
49
+ "valibot": "^1.0.0-rc.2",
50
50
  "@local/configs": "0.0.0"
51
51
  },
52
52
  "engines": {