eslint-plugin-react-hooks 6.1.0-canary-d85ec5f5-20250716 → 6.1.0-canary-dffacc7b-20250717
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.
|
@@ -20852,6 +20852,7 @@ const BuiltInFireId = 'BuiltInFire';
|
|
|
20852
20852
|
const BuiltInFireFunctionId = 'BuiltInFireFunction';
|
|
20853
20853
|
const BuiltInUseEffectEventId = 'BuiltInUseEffectEvent';
|
|
20854
20854
|
const BuiltinEffectEventId = 'BuiltInEffectEventFunction';
|
|
20855
|
+
const BuiltInAutodepsId = 'BuiltInAutoDepsId';
|
|
20855
20856
|
const ReanimatedSharedValueId = 'ReanimatedSharedValueId';
|
|
20856
20857
|
const BUILTIN_SHAPES = new Map();
|
|
20857
20858
|
addObject(BUILTIN_SHAPES, BuiltInPropsId, [
|
|
@@ -29678,6 +29679,7 @@ const REACT_APIS = [
|
|
|
29678
29679
|
returnValueKind: ValueKind.Frozen,
|
|
29679
29680
|
}, BuiltInUseEffectEventId),
|
|
29680
29681
|
],
|
|
29682
|
+
['AUTODEPS', addObject(DEFAULT_SHAPES, BuiltInAutodepsId, [])],
|
|
29681
29683
|
];
|
|
29682
29684
|
TYPED_GLOBALS.push([
|
|
29683
29685
|
'React',
|
|
@@ -45185,7 +45187,12 @@ function inferEffectDependencies(fn) {
|
|
|
45185
45187
|
else if (value.kind === 'CallExpression' ||
|
|
45186
45188
|
value.kind === 'MethodCall') {
|
|
45187
45189
|
const callee = value.kind === 'CallExpression' ? value.callee : value.property;
|
|
45188
|
-
|
|
45190
|
+
const autodepsArgIndex = value.args.findIndex(arg => arg.kind === 'Identifier' &&
|
|
45191
|
+
arg.identifier.type.kind === 'Object' &&
|
|
45192
|
+
arg.identifier.type.shapeId === BuiltInAutodepsId);
|
|
45193
|
+
if (value.args.length > 1 &&
|
|
45194
|
+
autodepsArgIndex > 0 &&
|
|
45195
|
+
autodepFnLoads.has(callee.identifier.id) &&
|
|
45189
45196
|
value.args[0].kind === 'Identifier') {
|
|
45190
45197
|
const effectDeps = [];
|
|
45191
45198
|
const deps = {
|
|
@@ -45252,7 +45259,7 @@ function inferEffectDependencies(fn) {
|
|
|
45252
45259
|
effects: null,
|
|
45253
45260
|
},
|
|
45254
45261
|
});
|
|
45255
|
-
value.args
|
|
45262
|
+
value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
|
|
45256
45263
|
fn.env.inferredEffectLocations.add(callee.loc);
|
|
45257
45264
|
}
|
|
45258
45265
|
else if (loadGlobals.has(value.args[0].identifier.id)) {
|
|
@@ -45267,7 +45274,7 @@ function inferEffectDependencies(fn) {
|
|
|
45267
45274
|
effects: null,
|
|
45268
45275
|
},
|
|
45269
45276
|
});
|
|
45270
|
-
value.args
|
|
45277
|
+
value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
|
|
45271
45278
|
fn.env.inferredEffectLocations.add(callee.loc);
|
|
45272
45279
|
}
|
|
45273
45280
|
}
|
|
@@ -45301,6 +45308,7 @@ function inferEffectDependencies(fn) {
|
|
|
45301
45308
|
markPredecessors(fn.body);
|
|
45302
45309
|
markInstructionIds(fn.body);
|
|
45303
45310
|
fixScopeAndIdentifierRanges(fn.body);
|
|
45311
|
+
deadCodeElimination(fn);
|
|
45304
45312
|
fn.env.hasInferredEffect = true;
|
|
45305
45313
|
}
|
|
45306
45314
|
}
|
|
@@ -45337,7 +45345,7 @@ function rewriteSplices(originalBlock, splices, rewriteBlocks) {
|
|
|
45337
45345
|
if (rewrite.kind === 'instr') {
|
|
45338
45346
|
currBlock.instructions.push(rewrite.value);
|
|
45339
45347
|
}
|
|
45340
|
-
else {
|
|
45348
|
+
else if (rewrite.kind === 'block') {
|
|
45341
45349
|
const { entry, blocks } = rewrite.value;
|
|
45342
45350
|
const entryBlock = blocks.get(entry);
|
|
45343
45351
|
currBlock.instructions.push(...entryBlock.instructions);
|
|
@@ -20843,6 +20843,7 @@ const BuiltInFireId = 'BuiltInFire';
|
|
|
20843
20843
|
const BuiltInFireFunctionId = 'BuiltInFireFunction';
|
|
20844
20844
|
const BuiltInUseEffectEventId = 'BuiltInUseEffectEvent';
|
|
20845
20845
|
const BuiltinEffectEventId = 'BuiltInEffectEventFunction';
|
|
20846
|
+
const BuiltInAutodepsId = 'BuiltInAutoDepsId';
|
|
20846
20847
|
const ReanimatedSharedValueId = 'ReanimatedSharedValueId';
|
|
20847
20848
|
const BUILTIN_SHAPES = new Map();
|
|
20848
20849
|
addObject(BUILTIN_SHAPES, BuiltInPropsId, [
|
|
@@ -29505,6 +29506,7 @@ const REACT_APIS = [
|
|
|
29505
29506
|
returnValueKind: ValueKind.Frozen,
|
|
29506
29507
|
}, BuiltInUseEffectEventId),
|
|
29507
29508
|
],
|
|
29509
|
+
['AUTODEPS', addObject(DEFAULT_SHAPES, BuiltInAutodepsId, [])],
|
|
29508
29510
|
];
|
|
29509
29511
|
TYPED_GLOBALS.push([
|
|
29510
29512
|
'React',
|
|
@@ -45012,7 +45014,12 @@ function inferEffectDependencies(fn) {
|
|
|
45012
45014
|
else if (value.kind === 'CallExpression' ||
|
|
45013
45015
|
value.kind === 'MethodCall') {
|
|
45014
45016
|
const callee = value.kind === 'CallExpression' ? value.callee : value.property;
|
|
45015
|
-
|
|
45017
|
+
const autodepsArgIndex = value.args.findIndex(arg => arg.kind === 'Identifier' &&
|
|
45018
|
+
arg.identifier.type.kind === 'Object' &&
|
|
45019
|
+
arg.identifier.type.shapeId === BuiltInAutodepsId);
|
|
45020
|
+
if (value.args.length > 1 &&
|
|
45021
|
+
autodepsArgIndex > 0 &&
|
|
45022
|
+
autodepFnLoads.has(callee.identifier.id) &&
|
|
45016
45023
|
value.args[0].kind === 'Identifier') {
|
|
45017
45024
|
const effectDeps = [];
|
|
45018
45025
|
const deps = {
|
|
@@ -45079,7 +45086,7 @@ function inferEffectDependencies(fn) {
|
|
|
45079
45086
|
effects: null,
|
|
45080
45087
|
},
|
|
45081
45088
|
});
|
|
45082
|
-
value.args
|
|
45089
|
+
value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
|
|
45083
45090
|
fn.env.inferredEffectLocations.add(callee.loc);
|
|
45084
45091
|
}
|
|
45085
45092
|
else if (loadGlobals.has(value.args[0].identifier.id)) {
|
|
@@ -45094,7 +45101,7 @@ function inferEffectDependencies(fn) {
|
|
|
45094
45101
|
effects: null,
|
|
45095
45102
|
},
|
|
45096
45103
|
});
|
|
45097
|
-
value.args
|
|
45104
|
+
value.args[autodepsArgIndex] = Object.assign(Object.assign({}, depsPlace), { effect: Effect.Freeze });
|
|
45098
45105
|
fn.env.inferredEffectLocations.add(callee.loc);
|
|
45099
45106
|
}
|
|
45100
45107
|
}
|
|
@@ -45128,6 +45135,7 @@ function inferEffectDependencies(fn) {
|
|
|
45128
45135
|
markPredecessors(fn.body);
|
|
45129
45136
|
markInstructionIds(fn.body);
|
|
45130
45137
|
fixScopeAndIdentifierRanges(fn.body);
|
|
45138
|
+
deadCodeElimination(fn);
|
|
45131
45139
|
fn.env.hasInferredEffect = true;
|
|
45132
45140
|
}
|
|
45133
45141
|
}
|
|
@@ -45164,7 +45172,7 @@ function rewriteSplices(originalBlock, splices, rewriteBlocks) {
|
|
|
45164
45172
|
if (rewrite.kind === 'instr') {
|
|
45165
45173
|
currBlock.instructions.push(rewrite.value);
|
|
45166
45174
|
}
|
|
45167
|
-
else {
|
|
45175
|
+
else if (rewrite.kind === 'block') {
|
|
45168
45176
|
const { entry, blocks } = rewrite.value;
|
|
45169
45177
|
const entryBlock = blocks.get(entry);
|
|
45170
45178
|
currBlock.instructions.push(...entryBlock.instructions);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-react-hooks",
|
|
3
3
|
"description": "ESLint rules for React Hooks",
|
|
4
|
-
"version": "6.1.0-canary-
|
|
4
|
+
"version": "6.1.0-canary-dffacc7b-20250717",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/facebook/react.git",
|