Skip to content

Commit c6e1ba0

Browse files
Rel1cxCopilot
andauthored
docs: update packages/plugins/eslint-plugin-react-x/src/rules/no-forward-ref.ts
Co-authored-by: Copilot <[email protected]> Signed-off-by: REL1CX <[email protected]>
1 parent bce4552 commit c6e1ba0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/plugins/eslint-plugin-react-x/src/rules/no-forward-ref.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ export function create(context: RuleContext<MessageID, []>): RuleListener {
6161
};
6262
}
6363

64+
/**
65+
* Determines whether the given CallExpression can be safely auto-fixed by replacing
66+
* the usage of `forwardRef` with passing `ref` as a prop.
67+
*
68+
* @param context - The rule context object.
69+
* @param node - The CallExpression node to check.
70+
* @returns True if the call can be auto-fixed, false otherwise.
71+
*/
6472
function canFix(context: RuleContext, node: TSESTree.CallExpression) {
6573
const { importSource } = getSettingsFromContext(context);
6674
const initialScope = context.sourceCode.getScope(node);

0 commit comments

Comments
 (0)