eslint-plugin-react-hooks 6.0.0-rc1 → 6.0.0

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.
@@ -17078,6 +17078,9 @@ function isSetActionStateType(id) {
17078
17078
  function isDispatcherType(id) {
17079
17079
  return id.type.kind === 'Function' && id.type.shapeId === 'BuiltInDispatch';
17080
17080
  }
17081
+ function isFireFunctionType(id) {
17082
+ return (id.type.kind === 'Function' && id.type.shapeId === 'BuiltInFireFunction');
17083
+ }
17081
17084
  function isStableType(id) {
17082
17085
  return (isSetStateType(id) ||
17083
17086
  isSetActionStateType(id) ||
@@ -28695,6 +28698,7 @@ const BuiltInUseContextHookId = 'BuiltInUseContextHook';
28695
28698
  const BuiltInUseTransitionId = 'BuiltInUseTransition';
28696
28699
  const BuiltInStartTransitionId = 'BuiltInStartTransition';
28697
28700
  const BuiltInFireId = 'BuiltInFire';
28701
+ const BuiltInFireFunctionId = 'BuiltInFireFunction';
28698
28702
  const BUILTIN_SHAPES = new Map();
28699
28703
  addObject(BUILTIN_SHAPES, BuiltInPropsId, [
28700
28704
  ['ref', { kind: 'Object', shapeId: BuiltInUseRefId }],
@@ -37003,7 +37007,12 @@ const REACT_APIS = [
37003
37007
  addFunction(DEFAULT_SHAPES, [], {
37004
37008
  positionalParams: [],
37005
37009
  restParam: null,
37006
- returnType: { kind: 'Primitive' },
37010
+ returnType: {
37011
+ kind: 'Function',
37012
+ return: { kind: 'Poly' },
37013
+ shapeId: BuiltInFireFunctionId,
37014
+ isConstructor: false,
37015
+ },
37007
37016
  calleeEffect: Effect.Read,
37008
37017
  returnValueKind: ValueKind.Frozen,
37009
37018
  }, BuiltInFireId),
@@ -48240,9 +48249,10 @@ function inferEffectDependencies(fn) {
48240
48249
  });
48241
48250
  }
48242
48251
  for (const dep of scopeInfo.deps) {
48243
- if ((isUseRefType(dep.identifier) ||
48252
+ if (((isUseRefType(dep.identifier) ||
48244
48253
  isSetStateType(dep.identifier)) &&
48245
- !reactiveIds.has(dep.identifier.id)) {
48254
+ !reactiveIds.has(dep.identifier.id)) ||
48255
+ isFireFunctionType(dep.identifier)) {
48246
48256
  continue;
48247
48257
  }
48248
48258
  const { place, instructions } = writeDependencyToInstructions(dep, reactiveIds.has(dep.identifier.id), fn.env, fnExpr.loc);
@@ -53557,6 +53567,12 @@ class Context {
53557
53567
  }
53558
53568
  getOrGenerateFireFunctionBinding(callee, fireLoc) {
53559
53569
  const fireFunctionBinding = getOrInsertWith(__classPrivateFieldGet(this, _Context_fireCalleesToFireFunctions, "f"), callee.identifier.id, () => createTemporaryPlace(__classPrivateFieldGet(this, _Context_env, "f"), GeneratedSource));
53570
+ fireFunctionBinding.identifier.type = {
53571
+ kind: 'Function',
53572
+ shapeId: BuiltInFireFunctionId,
53573
+ return: { kind: 'Poly' },
53574
+ isConstructor: false,
53575
+ };
53560
53576
  __classPrivateFieldGet(this, _Context_capturedCalleeIdentifierIds, "f").set(callee.identifier.id, {
53561
53577
  fireFunctionBinding,
53562
53578
  capturedCalleeIdentifier: callee.identifier,
@@ -17069,6 +17069,9 @@ function isSetActionStateType(id) {
17069
17069
  function isDispatcherType(id) {
17070
17070
  return id.type.kind === 'Function' && id.type.shapeId === 'BuiltInDispatch';
17071
17071
  }
17072
+ function isFireFunctionType(id) {
17073
+ return (id.type.kind === 'Function' && id.type.shapeId === 'BuiltInFireFunction');
17074
+ }
17072
17075
  function isStableType(id) {
17073
17076
  return (isSetStateType(id) ||
17074
17077
  isSetActionStateType(id) ||
@@ -28686,6 +28689,7 @@ const BuiltInUseContextHookId = 'BuiltInUseContextHook';
28686
28689
  const BuiltInUseTransitionId = 'BuiltInUseTransition';
28687
28690
  const BuiltInStartTransitionId = 'BuiltInStartTransition';
28688
28691
  const BuiltInFireId = 'BuiltInFire';
28692
+ const BuiltInFireFunctionId = 'BuiltInFireFunction';
28689
28693
  const BUILTIN_SHAPES = new Map();
28690
28694
  addObject(BUILTIN_SHAPES, BuiltInPropsId, [
28691
28695
  ['ref', { kind: 'Object', shapeId: BuiltInUseRefId }],
@@ -36830,7 +36834,12 @@ const REACT_APIS = [
36830
36834
  addFunction(DEFAULT_SHAPES, [], {
36831
36835
  positionalParams: [],
36832
36836
  restParam: null,
36833
- returnType: { kind: 'Primitive' },
36837
+ returnType: {
36838
+ kind: 'Function',
36839
+ return: { kind: 'Poly' },
36840
+ shapeId: BuiltInFireFunctionId,
36841
+ isConstructor: false,
36842
+ },
36834
36843
  calleeEffect: Effect.Read,
36835
36844
  returnValueKind: ValueKind.Frozen,
36836
36845
  }, BuiltInFireId),
@@ -48067,9 +48076,10 @@ function inferEffectDependencies(fn) {
48067
48076
  });
48068
48077
  }
48069
48078
  for (const dep of scopeInfo.deps) {
48070
- if ((isUseRefType(dep.identifier) ||
48079
+ if (((isUseRefType(dep.identifier) ||
48071
48080
  isSetStateType(dep.identifier)) &&
48072
- !reactiveIds.has(dep.identifier.id)) {
48081
+ !reactiveIds.has(dep.identifier.id)) ||
48082
+ isFireFunctionType(dep.identifier)) {
48073
48083
  continue;
48074
48084
  }
48075
48085
  const { place, instructions } = writeDependencyToInstructions(dep, reactiveIds.has(dep.identifier.id), fn.env, fnExpr.loc);
@@ -53384,6 +53394,12 @@ class Context {
53384
53394
  }
53385
53395
  getOrGenerateFireFunctionBinding(callee, fireLoc) {
53386
53396
  const fireFunctionBinding = getOrInsertWith(__classPrivateFieldGet(this, _Context_fireCalleesToFireFunctions, "f"), callee.identifier.id, () => createTemporaryPlace(__classPrivateFieldGet(this, _Context_env, "f"), GeneratedSource));
53397
+ fireFunctionBinding.identifier.type = {
53398
+ kind: 'Function',
53399
+ shapeId: BuiltInFireFunctionId,
53400
+ return: { kind: 'Poly' },
53401
+ isConstructor: false,
53402
+ };
53387
53403
  __classPrivateFieldGet(this, _Context_capturedCalleeIdentifierIds, "f").set(callee.identifier.id, {
53388
53404
  fireFunctionBinding,
53389
53405
  capturedCalleeIdentifier: callee.identifier,
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.0.0-rc1",
4
+ "version": "6.0.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/facebook/react.git",