Skip to content

Commit af3a92e

Browse files
committed
clean up comment
1 parent a84bc60 commit af3a92e

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

plugins/rules/memberAccess.ts

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,6 @@ import { TSESTree, AST_NODE_TYPES } from "@typescript-eslint/utils";
22
import { Scope } from "@typescript-eslint/utils/ts-eslint";
33
import createRule from "../utils/createRule.js";
44

5-
/**
6-
* Rule to optimize repeated member access patterns by extracting variables
7-
* For more rule details refer to docs/rules/no-repeated-member-access.md
8-
*
9-
* The following material is an overview of implementation details
10-
* It is divided into several phases
11-
*
12-
* 1. Analysis Phase:
13-
* - Traverse AST to identify member access chains (e.g., obj.prop.val)
14-
* - Store chains into hierarchical structures (e.g., ["obj", "obj.prop", "obj.prop.val"])
15-
* - Cache analysis results to avoid repeatedly processing
16-
*
17-
* 2. Tracking Phase:
18-
* - Count usage frequency of each chain within current scope
19-
* - Identify modified chains (assignments, increments, function calls, etc.)
20-
* - Mark all parts alongside the chain as modified
21-
*
22-
* 3. Reporting Phase:
23-
* - For chains that meet usage threshold and are not modified, suggest variable extraction
24-
* - Report only the longest valid chains
25-
*
26-
* Things to note:
27-
* - Only process chains starting with identifiers or "this" (avoid function call results)
28-
* - Skip computed property access (e.g., obj[key])
29-
* - Mark modified chains as un-extractable
30-
* - Support TypeScript non-null assertion operator (!) (minor bugs might still persist in some cases)
31-
*/
325
const noRepeatedMemberAccess = createRule({
336
name: "no-repeated-member-access",
347
meta: {

0 commit comments

Comments
 (0)