ExhaustiveDeps.ts — react Source File
Architecture documentation for ExhaustiveDeps.ts, a typescript file in the react codebase. 4 imports, 1 dependents.
Entity Profile
Dependency Diagram
graph LR ea02b01a_dd46_4b35_fe00_775aec496668["ExhaustiveDeps.ts"] 09c0f942_dfde_7720_a179_0571ede43aad["Utils.ts"] ea02b01a_dd46_4b35_fe00_775aec496668 --> 09c0f942_dfde_7720_a179_0571ede43aad 1a929da5_96c8_bcab_86db_7fe06b23af38["getAdditionalEffectHooksFromSettings"] ea02b01a_dd46_4b35_fe00_775aec496668 --> 1a929da5_96c8_bcab_86db_7fe06b23af38 e023ae51_0bf7_c8b1_0545_8e7304e4bb72["eslint"] ea02b01a_dd46_4b35_fe00_775aec496668 --> e023ae51_0bf7_c8b1_0545_8e7304e4bb72 14c74228_2987_7343_cb97_b89a9b190db6["estree"] ea02b01a_dd46_4b35_fe00_775aec496668 --> 14c74228_2987_7343_cb97_b89a9b190db6 b4590b6e_50d1_c664_5047_3e6e187f6b97["index.ts"] b4590b6e_50d1_c664_5047_3e6e187f6b97 --> ea02b01a_dd46_4b35_fe00_775aec496668 style ea02b01a_dd46_4b35_fe00_775aec496668 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/* eslint-disable no-for-of-loops/no-for-of-loops */
import type {Rule, Scope} from 'eslint';
import type {
ArrayExpression,
ArrowFunctionExpression,
CallExpression,
Expression,
FunctionDeclaration,
FunctionExpression,
Identifier,
Node,
Pattern,
PrivateIdentifier,
Super,
VariableDeclarator,
} from 'estree';
import {getAdditionalEffectHooksFromSettings} from '../shared/Utils';
type DeclaredDependency = {
key: string;
node: Node;
};
type Dependency = {
isStable: boolean;
references: Array<Scope.Reference>;
};
type DependencyTreeNode = {
isUsed: boolean; // True if used in code
isSatisfiedRecursively: boolean; // True if specified in deps
isSubtreeUsed: boolean; // True if something deeper is used by code
children: Map<string, DependencyTreeNode>; // Nodes for properties
};
const rule = {
meta: {
type: 'suggestion',
docs: {
description:
'verifies the list of dependencies for Hooks like useEffect and similar',
recommended: true,
url: 'https://github.com/facebook/react/issues/14920',
},
fixable: 'code',
hasSuggestions: true,
schema: [
{
type: 'object',
additionalProperties: false,
enableDangerousAutofixThisMayCauseInfiniteLoops: false,
properties: {
additionalHooks: {
// ... (2079 more lines)
Domain
Subdomains
Functions
- analyzePropertyChain()
- collectRecommendations()
- fastFindReferenceWithParent()
- getConstructionExpressionType()
- getDependency()
- getNodeWithoutReactNamespace()
- getReactiveHookCallbackIndex()
- getUnknownDependenciesMessage()
- isAncestorNodeOf()
- isNodeLike()
- isSameIdentifier()
- isUseEffectEventIdentifier()
- joinEnglish()
- markNode()
- rule.create()
- scanForConstructions()
Dependencies
- Utils.ts
- eslint
- estree
- getAdditionalEffectHooksFromSettings
Imported By
Source
Frequently Asked Questions
What does ExhaustiveDeps.ts do?
ExhaustiveDeps.ts is a source file in the react codebase, written in typescript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in ExhaustiveDeps.ts?
ExhaustiveDeps.ts defines 16 function(s): analyzePropertyChain, collectRecommendations, fastFindReferenceWithParent, getConstructionExpressionType, getDependency, getNodeWithoutReactNamespace, getReactiveHookCallbackIndex, getUnknownDependenciesMessage, isAncestorNodeOf, isNodeLike, and 6 more.
What does ExhaustiveDeps.ts depend on?
ExhaustiveDeps.ts imports 4 module(s): Utils.ts, eslint, estree, getAdditionalEffectHooksFromSettings.
What files import ExhaustiveDeps.ts?
ExhaustiveDeps.ts is imported by 1 file(s): index.ts.
Where is ExhaustiveDeps.ts in the architecture?
ExhaustiveDeps.ts is located at packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts (domain: BabelCompiler, subdomain: Validation, directory: packages/eslint-plugin-react-hooks/src/rules).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free