Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979
Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979ledsun wants to merge 12 commits intojsx-eslint:masterfrom
Conversation
ljharb
left a comment
There was a problem hiding this comment.
we'll need regression tests - it might be as simple as adding eslint 10 to the GHA matrix.
f987ffa to
a7b967b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3979 +/- ##
==========================================
- Coverage 97.85% 97.81% -0.04%
==========================================
Files 136 136
Lines 10008 10013 +5
Branches 3717 3718 +1
==========================================
+ Hits 9793 9794 +1
- Misses 215 219 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Run published type checks against both ESLint 7 and 10. Use per-matrix dependency setup and exclude unsupported TS combinations for ESLint 10.
- route filename/sourceCode access through util helpers for ESLint 7/10 compatibility - remove deprecated meta.docs.category to satisfy current RuleModule typings - augment @eslint/core SettingsConfig with react settings shape
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Dom Armstrong <dom@dom-armstrong.co.uk>
| matrix: | ||
| node-version: ${{ fromJson(needs.matrix.outputs.latest) }} | ||
| eslint: | ||
| - 10 |
There was a problem hiding this comment.
you'll also need to exclude eslint 10 on node < 20
| const resolve = require('resolve'); | ||
| const semver = require('semver'); | ||
| const error = require('./error'); | ||
| const eslintUtil = require('./eslint'); |
There was a problem hiding this comment.
| const eslintUtil = require('./eslint'); | |
| const getFilename = require('./eslint').getFilename; |
| "@typescript-eslint/parser": "^2.34.0 || ^3.10.1 || ^4 || ^5 || ^6.20 || ^7.14.1 || 8.4 - 8.17", | ||
| "babel-eslint": "^8 || ^9 || ^10.1.0", | ||
| "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7", | ||
| "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 || ^10.0", |
There was a problem hiding this comment.
this might be premature; it's fine if the eslint 10 tests don't completely pass after this PR, and this line is what actually adds support for it.
however obv if this PR is sufficient to support eslint 10, this is great :-)
This PR follows up on the feedback in the comments of #3972 and incorporates the requested changes.
I think this PR will fix #3977.