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

Bug: Update context methods to source code methods #143

Closed
1 task
nzakas opened this issue Nov 22, 2023 · 2 comments · Fixed by #144
Closed
1 task

Bug: Update context methods to source code methods #143

nzakas opened this issue Nov 22, 2023 · 2 comments · Fixed by #144
Assignees
Milestone

Comments

@nzakas
Copy link

nzakas commented Nov 22, 2023

Environment

Node version: v20.9.0
npm version: v10.1.0
Local ESLint version: v8.52.0 (Currently used)
Global ESLint version: Not found
eslint-plugin-n version: v16.3.1
Operating System: win32 10.0.19045

What rule do you want to report?

all

Link to Minimal Reproducible Example

eslint/eslint#17698

What did you expect to happen?

I expected all of the rules to be updated based on this blog post:
https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/

As it is, many of the rules will throw an error in v9.0.0 due to the improper use of getScope() and getAncestors(). This is also blocking CI for the change that removes these methods.

Participation

  • I am willing to submit a pull request for this issue.

Additional comments

No response

@scagood
Copy link

scagood commented Nov 22, 2023

This is a much nicer way to write out what I did in #141! I am going to copy the content here and close it.

Thank you!


When we run the tests against eslint v8 we get the following warnings for ESLint v9:

(node:38222) DeprecationWarning: "exports-style" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "global-require" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "global-require" rule is using `context.getAncestors()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getAncestors()` instead.
(node:38222) DeprecationWarning: "handle-callback-err" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-deprecated-api" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-exports-assign" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-extraneous-require" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-hide-core-modules" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-missing-require" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-path-concat" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-restricted-require" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-unpublished-require" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-unsupported-features" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-unsupported-features/es-builtins" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-unsupported-features/es-syntax" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "no-unsupported-features/node-builtins" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "prefer-global/buffer" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "prefer-global/console" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "prefer-global/process" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.
(node:38222) DeprecationWarning: "prefer-global/text-decoder" rule is using `context.getScope()`, which is deprecated and will be removed in ESLint v9. Please use `sourceCode.getScope()` instead.

@aladdin-add
Copy link

I've made a wip PR, but it's being blocked by eslint-community/eslint-utils#171.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants