Skip to content

Commit

Permalink
docs: Add more removed context methods to migrate to v9 guide (#17951)
Browse files Browse the repository at this point in the history
* docs: Add more removed `context` methods to migrate to v9 guide

* show signatures for methods with new ones

Co-authored-by: Nitin Kumar <snitin315@gmail.com>

---------

Co-authored-by: Nitin Kumar <snitin315@gmail.com>
  • Loading branch information
mdjermanovic and snitin315 committed Jan 4, 2024
1 parent 07107a5 commit 7c78576
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions docs/src/use/migrate-to-9.0.0.md
Expand Up @@ -326,6 +326,15 @@ ESLint v9.0.0 removes multiple deprecated methods from the `context` object and
|`context.getTokensBefore()`|`sourceCode.getTokensBefore()`|
|`context.getTokensBetween()`|`sourceCode.getTokensBetween()`|
|`context.parserServices`|`sourceCode.parserServices`|
|`context.getDeclaredVariables()`|`sourceCode.getDeclaredVariables()`|

In addition to the methods in the above table, there are several other methods that are also moved but required different method signatures:

|**Removed on `context`**|**Replacement(s) on `SourceCode`**|
|-----------------------|--------------------------|
|`context.getAncestors()`|`sourceCode.getAncestors(node)`|
|`context.getScope()`|`sourceCode.getScope(node)`|
|`context.markVariableAsUsed(name)`|`sourceCode.markVariableAsUsed(name, node)`|

**To address:** Following the recommendations in the [blog post](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#from-context-to-sourcecode).

Expand Down

0 comments on commit 7c78576

Please sign in to comment.