Skip to content

Commit

Permalink
Update docs/src/extend/custom-rules.md
Browse files Browse the repository at this point in the history
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
nzakas and mdjermanovic committed Apr 20, 2023
1 parent eb54587 commit 984ff45
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/extend/custom-rules.md
Expand Up @@ -699,7 +699,7 @@ For examples of using `SourceCode#getScope()` to track variables, refer to the s

**Deprecated:** The `context.markVariableAsUsed()` method is deprecated in favor of `sourceCode.markVariableAsUsed()`.

Certain ESLint rules, such as [`no-unused-vars`](../rules/no-unused-vars), check to see if a rule has been used. ESLint itself only knows about the standard rules of variable access and so custom ways of accessing variables may not register as "used".
Certain ESLint rules, such as [`no-unused-vars`](../rules/no-unused-vars), check to see if a variable has been used. ESLint itself only knows about the standard rules of variable access and so custom ways of accessing variables may not register as "used".

To help with this, you can use the `sourceCode.markVariableAsUsed()` method. This method takes two arguments: the name of the variable to mark as used and an option reference node indicating the scope in which you are working. Here's an example:

Expand Down

0 comments on commit 984ff45

Please sign in to comment.