-
-
Notifications
You must be signed in to change notification settings - Fork 700
chore: remove ESLint compatibility code #2965
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
Conversation
This reverts commit f06309c.
|
3d4b39d to
b41f03a
Compare
they are not relevant anymore when the functions are available in all supported ESLint versions
FloEdelmann
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry @9romise, I pushed some changes that failed the tests. After reverting and even force-pushing to remove the commit, now the tests even fail for your last commit, where they previously passed. I guess something's in the cache somewhere that shouldn't be there.
Regarding your changes, those look good to me. Thank you for cleaning up! 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR removes ESLint compatibility code for older versions (< 8.57.0) and migrates to modern ESLint v9/v10 APIs. Since the minimum supported ESLint version is now 8.57.0, the code no longer needs to maintain backward-compatible wrappers for deprecated APIs.
- Updated TypeScript definitions to reflect required vs optional context properties
- Replaced deprecated method calls (
getSourceCode(),getFilename(),getCwd()) with direct property access (sourceCode,filename,cwd) - Removed the
markVariableAsUsedutility wrapper function sincecontext.sourceCode.markVariableAsUsedis now always available
Reviewed changes
Copilot reviewed 101 out of 102 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| typings/eslint/index.d.ts | Updated type definitions to mark deprecated methods as optional and new properties as required; clarified ESLint v10 deprecation comments |
| lib/utils/index.js | Removed markVariableAsUsed utility wrapper and simplified getDeclaredVariables implementation; updated all getSourceCode() calls to sourceCode property |
| lib/rules/*.js | Replaced deprecated method calls with direct property access across all rule files |
| tests/lib/utils/selector.js | Updated test utility to use context.sourceCode directly |
| lib/utils/*.js | Updated utility functions to use modern context properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ota-meshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
The CI error should be fixed in #2969.
Since our minimum supported version is currently ESLint 8.57.0.
This PR aligns with the migration guide at https://eslint.org/blog/2023/09/preparing-custom-rules-eslint-v9/, replacing certain APIs that will be removed in ESLint v10 with their modern equivalents.
Related: