Closed MikeMcC399 closed 4 months ago
@ihordiachenko
Can I ask you to review this PR please?
Workarounds are possible, however it would be nice to get this PR merged, even though it solves only one part of migration to ESLint v9 support.
Hi @MikeMcC399, thanks for your PR. I will look into it this Sunday
Lgtm. Will release it alongside #31 asap to fully address the ESLint v9 compatibility
@ihordiachenko
Lgtm. Will release it alongside #31 asap to fully address the ESLint v9 compatibility
Thank you very much for merging! I see that #31 is an issue, not a PR, so if there is any big delay I suggest you release without the resolution of #31 but with the ESLint v9 compatibility from this PR (#33).
See the following for the description about how it is possible to use this plugin already with ESLint v9, if you release it with the API fix:
https://eslint.org/blog/2022/08/new-config-system-part-2/#backwards-compatibility-utility https://www.npmjs.com/package/@eslint/eslintrc
@MikeMcC399 I am working on the flat config compatibility already. Should be ready today
@ihordiachenko
I am working on the flat config compatibility already. Should be ready today
Excellent! I want to include it in the ESLint v9 examples for cypress-io/eslint-plugin-cypress, so it will be very helpful to have your planned update! 👍🏻
Issue
Running the following in this repo (currently based on eslint@8.56.0):
results in the deprecation warning:
Change
Use the information in the blog post Preparing your custom rules for ESLint v9.0.0 from Sep 26, 2023 from the section [context.getAncestors()](https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/#context.getancestors()) to update the rule lib/rules/no-unused-expressions.js so that it is compatible with ESLint
v9
and with earlier ESLint versions.Verification
Deprecation
Confirm that deprecation is resolved by executing:
Verify that no deprecation warning is output and that all tests pass (81 passing).
Backwards compatibility
Install an earlier version of ESLint (
8.0.0
), before the replacement methodSourceCode#getAncestors(node)
was added, and confirm that tests continue to pass (81 passing).