@eslint-react/shared 1.23.3-next.7 → 1.23.3-next.8
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 +38 -10
- package/dist/index.d.ts +38 -10
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -2052,7 +2052,7 @@ Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
|
2052
2052
|
type BuiltIns = Primitive | void | Date | RegExp;
|
|
2053
2053
|
|
|
2054
2054
|
/**
|
|
2055
|
-
@see PartialDeep
|
|
2055
|
+
@see {@link PartialDeep}
|
|
2056
2056
|
*/
|
|
2057
2057
|
type PartialDeepOptions = {
|
|
2058
2058
|
/**
|
|
@@ -2061,6 +2061,32 @@ type PartialDeepOptions = {
|
|
|
2061
2061
|
@default false
|
|
2062
2062
|
*/
|
|
2063
2063
|
readonly recurseIntoArrays?: boolean;
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
Allows `undefined` values in non-tuple arrays.
|
|
2067
|
+
|
|
2068
|
+
- When set to `true`, elements of non-tuple arrays can be `undefined`.
|
|
2069
|
+
- When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
|
|
2070
|
+
|
|
2071
|
+
@default true
|
|
2072
|
+
|
|
2073
|
+
@example
|
|
2074
|
+
You can prevent `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}` as the second type argument:
|
|
2075
|
+
|
|
2076
|
+
```
|
|
2077
|
+
import type {PartialDeep} from 'type-fest';
|
|
2078
|
+
|
|
2079
|
+
type Settings = {
|
|
2080
|
+
languages: string[];
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}>;
|
|
2084
|
+
|
|
2085
|
+
partialSettings.languages = [undefined]; // Error
|
|
2086
|
+
partialSettings.languages = []; // Ok
|
|
2087
|
+
```
|
|
2088
|
+
*/
|
|
2089
|
+
readonly allowUndefinedInNonTupleArrays?: boolean;
|
|
2064
2090
|
};
|
|
2065
2091
|
|
|
2066
2092
|
/**
|
|
@@ -2076,12 +2102,12 @@ import type {PartialDeep} from 'type-fest';
|
|
|
2076
2102
|
|
|
2077
2103
|
const settings: Settings = {
|
|
2078
2104
|
textEditor: {
|
|
2079
|
-
fontSize: 14
|
|
2080
|
-
fontColor: '#000000'
|
|
2081
|
-
fontWeight: 400
|
|
2082
|
-
}
|
|
2083
|
-
autocomplete: false
|
|
2084
|
-
autosave: true
|
|
2105
|
+
fontSize: 14,
|
|
2106
|
+
fontColor: '#000000',
|
|
2107
|
+
fontWeight: 400
|
|
2108
|
+
},
|
|
2109
|
+
autocomplete: false,
|
|
2110
|
+
autosave: true
|
|
2085
2111
|
};
|
|
2086
2112
|
|
|
2087
2113
|
const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
|
|
@@ -2096,7 +2122,7 @@ By default, this does not affect elements in array and tuple types. You can chan
|
|
|
2096
2122
|
```
|
|
2097
2123
|
import type {PartialDeep} from 'type-fest';
|
|
2098
2124
|
|
|
2099
|
-
|
|
2125
|
+
type Settings = {
|
|
2100
2126
|
languages: string[];
|
|
2101
2127
|
}
|
|
2102
2128
|
|
|
@@ -2105,6 +2131,8 @@ const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
|
|
|
2105
2131
|
};
|
|
2106
2132
|
```
|
|
2107
2133
|
|
|
2134
|
+
@see {@link PartialDeepOptions}
|
|
2135
|
+
|
|
2108
2136
|
@category Object
|
|
2109
2137
|
@category Array
|
|
2110
2138
|
@category Set
|
|
@@ -2125,8 +2153,8 @@ type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIn
|
|
|
2125
2153
|
? Options['recurseIntoArrays'] extends true
|
|
2126
2154
|
? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
2127
2155
|
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
2128
|
-
? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>
|
|
2129
|
-
: Array<PartialDeep<ItemType | undefined, Options>>
|
|
2156
|
+
? ReadonlyArray<PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
|
|
2157
|
+
: Array<PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
|
|
2130
2158
|
: PartialObjectDeep<T, Options> // Tuples behave properly
|
|
2131
2159
|
: T // If they don't opt into array testing, just use the original type
|
|
2132
2160
|
: PartialObjectDeep<T, Options>
|
package/dist/index.d.ts
CHANGED
|
@@ -2052,7 +2052,7 @@ Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
|
2052
2052
|
type BuiltIns = Primitive | void | Date | RegExp;
|
|
2053
2053
|
|
|
2054
2054
|
/**
|
|
2055
|
-
@see PartialDeep
|
|
2055
|
+
@see {@link PartialDeep}
|
|
2056
2056
|
*/
|
|
2057
2057
|
type PartialDeepOptions = {
|
|
2058
2058
|
/**
|
|
@@ -2061,6 +2061,32 @@ type PartialDeepOptions = {
|
|
|
2061
2061
|
@default false
|
|
2062
2062
|
*/
|
|
2063
2063
|
readonly recurseIntoArrays?: boolean;
|
|
2064
|
+
|
|
2065
|
+
/**
|
|
2066
|
+
Allows `undefined` values in non-tuple arrays.
|
|
2067
|
+
|
|
2068
|
+
- When set to `true`, elements of non-tuple arrays can be `undefined`.
|
|
2069
|
+
- When set to `false`, only explicitly defined elements are allowed in non-tuple arrays, ensuring stricter type checking.
|
|
2070
|
+
|
|
2071
|
+
@default true
|
|
2072
|
+
|
|
2073
|
+
@example
|
|
2074
|
+
You can prevent `undefined` values in non-tuple arrays by passing `{recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}` as the second type argument:
|
|
2075
|
+
|
|
2076
|
+
```
|
|
2077
|
+
import type {PartialDeep} from 'type-fest';
|
|
2078
|
+
|
|
2079
|
+
type Settings = {
|
|
2080
|
+
languages: string[];
|
|
2081
|
+
};
|
|
2082
|
+
|
|
2083
|
+
declare const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true; allowUndefinedInNonTupleArrays: false}>;
|
|
2084
|
+
|
|
2085
|
+
partialSettings.languages = [undefined]; // Error
|
|
2086
|
+
partialSettings.languages = []; // Ok
|
|
2087
|
+
```
|
|
2088
|
+
*/
|
|
2089
|
+
readonly allowUndefinedInNonTupleArrays?: boolean;
|
|
2064
2090
|
};
|
|
2065
2091
|
|
|
2066
2092
|
/**
|
|
@@ -2076,12 +2102,12 @@ import type {PartialDeep} from 'type-fest';
|
|
|
2076
2102
|
|
|
2077
2103
|
const settings: Settings = {
|
|
2078
2104
|
textEditor: {
|
|
2079
|
-
fontSize: 14
|
|
2080
|
-
fontColor: '#000000'
|
|
2081
|
-
fontWeight: 400
|
|
2082
|
-
}
|
|
2083
|
-
autocomplete: false
|
|
2084
|
-
autosave: true
|
|
2105
|
+
fontSize: 14,
|
|
2106
|
+
fontColor: '#000000',
|
|
2107
|
+
fontWeight: 400
|
|
2108
|
+
},
|
|
2109
|
+
autocomplete: false,
|
|
2110
|
+
autosave: true
|
|
2085
2111
|
};
|
|
2086
2112
|
|
|
2087
2113
|
const applySavedSettings = (savedSettings: PartialDeep<Settings>) => {
|
|
@@ -2096,7 +2122,7 @@ By default, this does not affect elements in array and tuple types. You can chan
|
|
|
2096
2122
|
```
|
|
2097
2123
|
import type {PartialDeep} from 'type-fest';
|
|
2098
2124
|
|
|
2099
|
-
|
|
2125
|
+
type Settings = {
|
|
2100
2126
|
languages: string[];
|
|
2101
2127
|
}
|
|
2102
2128
|
|
|
@@ -2105,6 +2131,8 @@ const partialSettings: PartialDeep<Settings, {recurseIntoArrays: true}> = {
|
|
|
2105
2131
|
};
|
|
2106
2132
|
```
|
|
2107
2133
|
|
|
2134
|
+
@see {@link PartialDeepOptions}
|
|
2135
|
+
|
|
2108
2136
|
@category Object
|
|
2109
2137
|
@category Array
|
|
2110
2138
|
@category Set
|
|
@@ -2125,8 +2153,8 @@ type PartialDeep<T, Options extends PartialDeepOptions = {}> = T extends BuiltIn
|
|
|
2125
2153
|
? Options['recurseIntoArrays'] extends true
|
|
2126
2154
|
? ItemType[] extends T // Test for arrays (non-tuples) specifically
|
|
2127
2155
|
? readonly ItemType[] extends T // Differentiate readonly and mutable arrays
|
|
2128
|
-
? ReadonlyArray<PartialDeep<ItemType | undefined, Options>>
|
|
2129
|
-
: Array<PartialDeep<ItemType | undefined, Options>>
|
|
2156
|
+
? ReadonlyArray<PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
|
|
2157
|
+
: Array<PartialDeep<Options['allowUndefinedInNonTupleArrays'] extends false ? ItemType : ItemType | undefined, Options>>
|
|
2130
2158
|
: PartialObjectDeep<T, Options> // Tuples behave properly
|
|
2131
2159
|
: T // If they don't opt into array testing, just use the original type
|
|
2132
2160
|
: PartialObjectDeep<T, Options>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eslint-react/shared",
|
|
3
|
-
"version": "1.23.3-next.
|
|
3
|
+
"version": "1.23.3-next.8",
|
|
4
4
|
"description": "ESLint React's Shared constants and functions.",
|
|
5
5
|
"homepage": "https://github.com/rEl1cx/eslint-react",
|
|
6
6
|
"bugs": {
|
|
@@ -36,14 +36,14 @@
|
|
|
36
36
|
"@typescript-eslint/utils": "^8.19.1",
|
|
37
37
|
"picomatch": "^4.0.2",
|
|
38
38
|
"ts-pattern": "^5.6.0",
|
|
39
|
-
"@eslint-react/eff": "1.23.3-next.
|
|
39
|
+
"@eslint-react/eff": "1.23.3-next.8"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/picomatch": "^3.0.1",
|
|
43
43
|
"fast-equals": "^5.2.2",
|
|
44
44
|
"micro-memoize": "^4.1.3",
|
|
45
45
|
"tsup": "^8.3.5",
|
|
46
|
-
"type-fest": "^4.
|
|
46
|
+
"type-fest": "^4.32.0",
|
|
47
47
|
"valibot": "^1.0.0-beta.11",
|
|
48
48
|
"@workspace/configs": "0.0.0"
|
|
49
49
|
},
|