eslint-plugin-react-x 5.9.1 → 5.9.2
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 +34 -34
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -143,7 +143,7 @@ const rules$6 = {
|
|
|
143
143
|
//#endregion
|
|
144
144
|
//#region package.json
|
|
145
145
|
var name$6 = "eslint-plugin-react-x";
|
|
146
|
-
var version = "5.9.
|
|
146
|
+
var version = "5.9.2";
|
|
147
147
|
|
|
148
148
|
//#endregion
|
|
149
149
|
//#region src/utils/create-rule.ts
|
|
@@ -1145,7 +1145,7 @@ function getUnknownDependenciesMessage(reactiveHookName) {
|
|
|
1145
1145
|
* Array methods that mutate the array in place.
|
|
1146
1146
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1147
1147
|
*/
|
|
1148
|
-
const MUTATING_ARRAY_METHODS$1 = new Set([
|
|
1148
|
+
const MUTATING_ARRAY_METHODS$1 = /* @__PURE__ */ new Set([
|
|
1149
1149
|
"copyWithin",
|
|
1150
1150
|
"fill",
|
|
1151
1151
|
"pop",
|
|
@@ -1283,7 +1283,7 @@ function create$49(context) {
|
|
|
1283
1283
|
* Array methods that mutate the array in place.
|
|
1284
1284
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
|
|
1285
1285
|
*/
|
|
1286
|
-
const MUTATING_ARRAY_METHODS = new Set([
|
|
1286
|
+
const MUTATING_ARRAY_METHODS = /* @__PURE__ */ new Set([
|
|
1287
1287
|
"copyWithin",
|
|
1288
1288
|
"fill",
|
|
1289
1289
|
"pop",
|
|
@@ -1804,7 +1804,7 @@ function report$2(context) {
|
|
|
1804
1804
|
* `map` and `forEach` also cover `Children.map` and `Children.forEach`,
|
|
1805
1805
|
* whose callback is the second argument instead of the first.
|
|
1806
1806
|
*/
|
|
1807
|
-
const INDEX_PARAM_POSITIONS$1 = new Map([
|
|
1807
|
+
const INDEX_PARAM_POSITIONS$1 = /* @__PURE__ */ new Map([
|
|
1808
1808
|
["every", 1],
|
|
1809
1809
|
["filter", 1],
|
|
1810
1810
|
["find", 1],
|
|
@@ -1861,7 +1861,7 @@ function getIdentifiersFromBinaryExpression(side) {
|
|
|
1861
1861
|
//#region src/rules/no-array-index-key/no-array-index-key.ts
|
|
1862
1862
|
const RULE_NAME$46 = "no-array-index-key";
|
|
1863
1863
|
/** Global functions that convert their first argument while preserving its identity as a key. */
|
|
1864
|
-
const COERCION_FUNCTIONS = new Set(["Number", "String"]);
|
|
1864
|
+
const COERCION_FUNCTIONS = /* @__PURE__ */ new Set(["Number", "String"]);
|
|
1865
1865
|
var no_array_index_key_default = createRule({
|
|
1866
1866
|
meta: {
|
|
1867
1867
|
type: "suggestion",
|
|
@@ -2822,7 +2822,7 @@ function create$25(context) {
|
|
|
2822
2822
|
* mapped to the position of the callback in the call's argument list.
|
|
2823
2823
|
* `from` covers `Array.from(iterable, mapFn)`.
|
|
2824
2824
|
*/
|
|
2825
|
-
const INDEX_PARAM_POSITIONS = new Map([
|
|
2825
|
+
const INDEX_PARAM_POSITIONS = /* @__PURE__ */ new Map([
|
|
2826
2826
|
["flatMap", 0],
|
|
2827
2827
|
["from", 1],
|
|
2828
2828
|
["map", 0]
|
|
@@ -3569,7 +3569,7 @@ function create$12(context, [options]) {
|
|
|
3569
3569
|
|
|
3570
3570
|
//#endregion
|
|
3571
3571
|
//#region src/rules/no-unused-class-component-members/lib.ts
|
|
3572
|
-
const LIFECYCLE_METHODS = new Set([
|
|
3572
|
+
const LIFECYCLE_METHODS = /* @__PURE__ */ new Set([
|
|
3573
3573
|
"componentDidCatch",
|
|
3574
3574
|
"componentDidMount",
|
|
3575
3575
|
"componentDidUpdate",
|
|
@@ -3902,8 +3902,8 @@ function create$8(context) {
|
|
|
3902
3902
|
/**
|
|
3903
3903
|
* Known impure functions
|
|
3904
3904
|
*/
|
|
3905
|
-
const IMPURE_FUNCS = new Map([
|
|
3906
|
-
["Atomics", new Set([
|
|
3905
|
+
const IMPURE_FUNCS = /* @__PURE__ */ new Map([
|
|
3906
|
+
["Atomics", /* @__PURE__ */ new Set([
|
|
3907
3907
|
"add",
|
|
3908
3908
|
"and",
|
|
3909
3909
|
"compareExchange",
|
|
@@ -3917,28 +3917,28 @@ const IMPURE_FUNCS = new Map([
|
|
|
3917
3917
|
"waitAsync",
|
|
3918
3918
|
"xor"
|
|
3919
3919
|
])],
|
|
3920
|
-
["caches", new Set([
|
|
3920
|
+
["caches", /* @__PURE__ */ new Set([
|
|
3921
3921
|
"delete",
|
|
3922
3922
|
"has",
|
|
3923
3923
|
"keys",
|
|
3924
3924
|
"match",
|
|
3925
3925
|
"open"
|
|
3926
3926
|
])],
|
|
3927
|
-
["clipboard", new Set([
|
|
3927
|
+
["clipboard", /* @__PURE__ */ new Set([
|
|
3928
3928
|
"read",
|
|
3929
3929
|
"readText",
|
|
3930
3930
|
"write",
|
|
3931
3931
|
"writeText"
|
|
3932
3932
|
])],
|
|
3933
|
-
["cookieStore", new Set([
|
|
3933
|
+
["cookieStore", /* @__PURE__ */ new Set([
|
|
3934
3934
|
"delete",
|
|
3935
3935
|
"get",
|
|
3936
3936
|
"getAll",
|
|
3937
3937
|
"set"
|
|
3938
3938
|
])],
|
|
3939
|
-
["crypto", new Set(["getRandomValues", "randomUUID"])],
|
|
3940
|
-
["Date", new Set(["now"])],
|
|
3941
|
-
["document", new Set([
|
|
3939
|
+
["crypto", /* @__PURE__ */ new Set(["getRandomValues", "randomUUID"])],
|
|
3940
|
+
["Date", /* @__PURE__ */ new Set(["now"])],
|
|
3941
|
+
["document", /* @__PURE__ */ new Set([
|
|
3942
3942
|
"adoptNode",
|
|
3943
3943
|
"append",
|
|
3944
3944
|
"close",
|
|
@@ -3981,7 +3981,7 @@ const IMPURE_FUNCS = new Map([
|
|
|
3981
3981
|
"write",
|
|
3982
3982
|
"writeln"
|
|
3983
3983
|
])],
|
|
3984
|
-
["globalThis", new Set([
|
|
3984
|
+
["globalThis", /* @__PURE__ */ new Set([
|
|
3985
3985
|
"addEventListener",
|
|
3986
3986
|
"alert",
|
|
3987
3987
|
"blur",
|
|
@@ -4018,32 +4018,32 @@ const IMPURE_FUNCS = new Map([
|
|
|
4018
4018
|
"stop",
|
|
4019
4019
|
"structuredClone"
|
|
4020
4020
|
])],
|
|
4021
|
-
["history", new Set([
|
|
4021
|
+
["history", /* @__PURE__ */ new Set([
|
|
4022
4022
|
"back",
|
|
4023
4023
|
"forward",
|
|
4024
4024
|
"go",
|
|
4025
4025
|
"pushState",
|
|
4026
4026
|
"replaceState"
|
|
4027
4027
|
])],
|
|
4028
|
-
["indexedDB", new Set([
|
|
4028
|
+
["indexedDB", /* @__PURE__ */ new Set([
|
|
4029
4029
|
"databases",
|
|
4030
4030
|
"deleteDatabase",
|
|
4031
4031
|
"open"
|
|
4032
4032
|
])],
|
|
4033
|
-
["localStorage", new Set([
|
|
4033
|
+
["localStorage", /* @__PURE__ */ new Set([
|
|
4034
4034
|
"clear",
|
|
4035
4035
|
"getItem",
|
|
4036
4036
|
"key",
|
|
4037
4037
|
"removeItem",
|
|
4038
4038
|
"setItem"
|
|
4039
4039
|
])],
|
|
4040
|
-
["location", new Set([
|
|
4040
|
+
["location", /* @__PURE__ */ new Set([
|
|
4041
4041
|
"assign",
|
|
4042
4042
|
"reload",
|
|
4043
4043
|
"replace"
|
|
4044
4044
|
])],
|
|
4045
|
-
["Math", new Set(["random"])],
|
|
4046
|
-
["navigation", new Set([
|
|
4045
|
+
["Math", /* @__PURE__ */ new Set(["random"])],
|
|
4046
|
+
["navigation", /* @__PURE__ */ new Set([
|
|
4047
4047
|
"back",
|
|
4048
4048
|
"forward",
|
|
4049
4049
|
"navigate",
|
|
@@ -4051,7 +4051,7 @@ const IMPURE_FUNCS = new Map([
|
|
|
4051
4051
|
"traverseTo",
|
|
4052
4052
|
"updateCurrentEntry"
|
|
4053
4053
|
])],
|
|
4054
|
-
["navigator", new Set([
|
|
4054
|
+
["navigator", /* @__PURE__ */ new Set([
|
|
4055
4055
|
"canShare",
|
|
4056
4056
|
"getBattery",
|
|
4057
4057
|
"getGamepads",
|
|
@@ -4064,8 +4064,8 @@ const IMPURE_FUNCS = new Map([
|
|
|
4064
4064
|
"share",
|
|
4065
4065
|
"vibrate"
|
|
4066
4066
|
])],
|
|
4067
|
-
["Notification", new Set(["requestPermission"])],
|
|
4068
|
-
["Object", new Set([
|
|
4067
|
+
["Notification", /* @__PURE__ */ new Set(["requestPermission"])],
|
|
4068
|
+
["Object", /* @__PURE__ */ new Set([
|
|
4069
4069
|
"assign",
|
|
4070
4070
|
"defineProperties",
|
|
4071
4071
|
"defineProperty",
|
|
@@ -4074,7 +4074,7 @@ const IMPURE_FUNCS = new Map([
|
|
|
4074
4074
|
"seal",
|
|
4075
4075
|
"setPrototypeOf"
|
|
4076
4076
|
])],
|
|
4077
|
-
["performance", new Set([
|
|
4077
|
+
["performance", /* @__PURE__ */ new Set([
|
|
4078
4078
|
"clearMarks",
|
|
4079
4079
|
"clearMeasures",
|
|
4080
4080
|
"getEntries",
|
|
@@ -4084,7 +4084,7 @@ const IMPURE_FUNCS = new Map([
|
|
|
4084
4084
|
"measure",
|
|
4085
4085
|
"now"
|
|
4086
4086
|
])],
|
|
4087
|
-
["process", new Set([
|
|
4087
|
+
["process", /* @__PURE__ */ new Set([
|
|
4088
4088
|
"abort",
|
|
4089
4089
|
"chdir",
|
|
4090
4090
|
"cpuUsage",
|
|
@@ -4098,23 +4098,23 @@ const IMPURE_FUNCS = new Map([
|
|
|
4098
4098
|
"stderr",
|
|
4099
4099
|
"stdout"
|
|
4100
4100
|
])],
|
|
4101
|
-
["Reflect", new Set([
|
|
4101
|
+
["Reflect", /* @__PURE__ */ new Set([
|
|
4102
4102
|
"defineProperty",
|
|
4103
4103
|
"deleteProperty",
|
|
4104
4104
|
"preventExtensions",
|
|
4105
4105
|
"set",
|
|
4106
4106
|
"setPrototypeOf"
|
|
4107
4107
|
])],
|
|
4108
|
-
["scheduler", new Set(["postTask", "yield"])],
|
|
4109
|
-
["sessionStorage", new Set([
|
|
4108
|
+
["scheduler", /* @__PURE__ */ new Set(["postTask", "yield"])],
|
|
4109
|
+
["sessionStorage", /* @__PURE__ */ new Set([
|
|
4110
4110
|
"clear",
|
|
4111
4111
|
"getItem",
|
|
4112
4112
|
"key",
|
|
4113
4113
|
"removeItem",
|
|
4114
4114
|
"setItem"
|
|
4115
4115
|
])],
|
|
4116
|
-
["URL", new Set(["createObjectURL", "revokeObjectURL"])],
|
|
4117
|
-
["window", new Set([
|
|
4116
|
+
["URL", /* @__PURE__ */ new Set(["createObjectURL", "revokeObjectURL"])],
|
|
4117
|
+
["window", /* @__PURE__ */ new Set([
|
|
4118
4118
|
"addEventListener",
|
|
4119
4119
|
"alert",
|
|
4120
4120
|
"blur",
|
|
@@ -4155,7 +4155,7 @@ const IMPURE_FUNCS = new Map([
|
|
|
4155
4155
|
/**
|
|
4156
4156
|
* Known impure global constructors used with `new`
|
|
4157
4157
|
*/
|
|
4158
|
-
const IMPURE_CTORS = new Set([
|
|
4158
|
+
const IMPURE_CTORS = /* @__PURE__ */ new Set([
|
|
4159
4159
|
"Audio",
|
|
4160
4160
|
"AudioContext",
|
|
4161
4161
|
"BroadcastChannel",
|
|
@@ -4448,7 +4448,7 @@ function create$6(context) {
|
|
|
4448
4448
|
"Program:exit"(program) {
|
|
4449
4449
|
const comps = fc.api.getAllComponents(program);
|
|
4450
4450
|
const hooks = hc.api.getAllHooks(program);
|
|
4451
|
-
const funcs = new Set([...comps.map((c) => c.node), ...hooks.map((h) => h.node)]);
|
|
4451
|
+
const funcs = /* @__PURE__ */ new Set([...comps.map((c) => c.node), ...hooks.map((h) => h.node)]);
|
|
4452
4452
|
const isCompOrHookFn = (n) => Check.isFunction(n) && funcs.has(n);
|
|
4453
4453
|
for (const { isWrite, node } of refAccesses) {
|
|
4454
4454
|
const obj = Extract.unwrap(node.object);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-x",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.2",
|
|
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.9.
|
|
49
|
-
"@eslint-react/core": "5.9.
|
|
50
|
-
"@eslint-react/eslint": "5.9.
|
|
51
|
-
"@eslint-react/
|
|
52
|
-
"@eslint-react/
|
|
53
|
-
"@eslint-react/
|
|
48
|
+
"@eslint-react/ast": "5.9.2",
|
|
49
|
+
"@eslint-react/core": "5.9.2",
|
|
50
|
+
"@eslint-react/eslint": "5.9.2",
|
|
51
|
+
"@eslint-react/jsx": "5.9.2",
|
|
52
|
+
"@eslint-react/shared": "5.9.2",
|
|
53
|
+
"@eslint-react/var": "5.9.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/react": "^19.2.17",
|