eslint-plugin-react-x 5.17.0 → 5.17.1
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.js +53 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -144,7 +144,7 @@ const rules$6 = {
|
|
|
144
144
|
//#endregion
|
|
145
145
|
//#region package.json
|
|
146
146
|
var name$6 = "eslint-plugin-react-x";
|
|
147
|
-
var version = "5.17.
|
|
147
|
+
var version = "5.17.1";
|
|
148
148
|
|
|
149
149
|
//#endregion
|
|
150
150
|
//#region src/utils/create-rule.ts
|
|
@@ -2966,6 +2966,58 @@ function getOrInsertComputed(map, key, callback) {
|
|
|
2966
2966
|
map.set(key, value);
|
|
2967
2967
|
return value;
|
|
2968
2968
|
}
|
|
2969
|
+
/**
|
|
2970
|
+
* Drops the longest prefix of elements from an array that satisfy the given predicate.
|
|
2971
|
+
*
|
|
2972
|
+
* Supports both data-first and data-last (`pipe`-friendly) call styles.
|
|
2973
|
+
*
|
|
2974
|
+
* @param pred - The predicate to test each element with.
|
|
2975
|
+
* @returns A new array without the matching prefix.
|
|
2976
|
+
* @example
|
|
2977
|
+
* ```ts
|
|
2978
|
+
* import * as assert from "node:assert"
|
|
2979
|
+
* import { dropWhile, pipe } from "@local/eff"
|
|
2980
|
+
*
|
|
2981
|
+
* // data-first
|
|
2982
|
+
* assert.deepStrictEqual(dropWhile([1, 2, 3, 2, 1], (n: number) => n < 3), [3, 2, 1])
|
|
2983
|
+
*
|
|
2984
|
+
* // data-last
|
|
2985
|
+
* assert.deepStrictEqual(pipe([1, 2, 3, 2, 1], dropWhile((n: number) => n < 3)), [3, 2, 1])
|
|
2986
|
+
* ```
|
|
2987
|
+
* @category array
|
|
2988
|
+
*/
|
|
2989
|
+
const dropWhile = dual(2, (xs, pred) => {
|
|
2990
|
+
const len = xs.length;
|
|
2991
|
+
let idx = 0;
|
|
2992
|
+
while (idx < len && pred(xs[idx])) idx++;
|
|
2993
|
+
return xs.slice(idx);
|
|
2994
|
+
});
|
|
2995
|
+
/**
|
|
2996
|
+
* Takes the longest prefix of elements from an array that satisfy the given predicate.
|
|
2997
|
+
*
|
|
2998
|
+
* Supports both data-first and data-last (`pipe`-friendly) call styles.
|
|
2999
|
+
*
|
|
3000
|
+
* @param pred - The predicate to test each element with.
|
|
3001
|
+
* @returns A new array containing only the matching prefix.
|
|
3002
|
+
* @example
|
|
3003
|
+
* ```ts
|
|
3004
|
+
* import * as assert from "node:assert"
|
|
3005
|
+
* import { pipe, takeWhile } from "@local/eff"
|
|
3006
|
+
*
|
|
3007
|
+
* // data-first
|
|
3008
|
+
* assert.deepStrictEqual(takeWhile([1, 2, 3, 2, 1], (n: number) => n < 3), [1, 2])
|
|
3009
|
+
*
|
|
3010
|
+
* // data-last
|
|
3011
|
+
* assert.deepStrictEqual(pipe([1, 2, 3, 2, 1], takeWhile((n: number) => n < 3)), [1, 2])
|
|
3012
|
+
* ```
|
|
3013
|
+
* @category array
|
|
3014
|
+
*/
|
|
3015
|
+
const takeWhile = dual(2, (xs, pred) => {
|
|
3016
|
+
const len = xs.length;
|
|
3017
|
+
let idx = 0;
|
|
3018
|
+
while (idx < len && pred(xs[idx])) idx++;
|
|
3019
|
+
return xs.slice(0, idx);
|
|
3020
|
+
});
|
|
2969
3021
|
|
|
2970
3022
|
//#endregion
|
|
2971
3023
|
//#region src/rules/no-leaked-conditional-rendering/lib.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "5.17.
|
|
3
|
+
"version": "5.17.1",
|
|
4
4
|
"description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"string-ts": "^2.3.1",
|
|
46
46
|
"ts-api-utils": "^2.5.0",
|
|
47
47
|
"ts-pattern": "^5.9.0",
|
|
48
|
-
"@eslint-react/ast": "5.17.
|
|
49
|
-
"@eslint-react/eslint": "5.17.
|
|
50
|
-
"@eslint-react/
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "5.17.1",
|
|
49
|
+
"@eslint-react/eslint": "5.17.1",
|
|
50
|
+
"@eslint-react/shared": "5.17.1",
|
|
51
|
+
"@eslint-react/core": "5.17.1",
|
|
52
|
+
"@eslint-react/jsx": "5.17.1",
|
|
53
|
+
"@eslint-react/var": "5.17.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.17",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"eslint": "^10.7.0",
|
|
60
60
|
"react": "^19.2.7",
|
|
61
61
|
"react-dom": "^19.2.7",
|
|
62
|
-
"tsdown": "^0.22.
|
|
62
|
+
"tsdown": "^0.22.8",
|
|
63
63
|
"tsl": "^1.0.30",
|
|
64
|
-
"tsl-dx": "^0.13.
|
|
64
|
+
"tsl-dx": "^0.13.3",
|
|
65
65
|
"typescript": "6.0.3",
|
|
66
66
|
"@local/configs": "0.0.0",
|
|
67
67
|
"@local/eff": "0.0.0"
|