Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add more removed context methods to migrate to v9 guide #17951

Merged
merged 2 commits into from Jan 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 9 additions & 0 deletions docs/src/use/migrate-to-9.0.0.md
Expand Up @@ -306,6 +306,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