-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Change Request: Backwards compatibility utility for rules #4
Comments
Sounds good to me, though it might be tricky for the wrapper rule to determine the currently traversed node, which is needed when calling some of the new methods (e.g., |
I actually already have a prototype of this working. 👍 |
SGTM! 👍 Re the naming of this package: there may be other versions needed in the future, considering |
I think I'll go with |
ESLint version
HEAD
What problem do you want to solve?
After talking with folks online, it seems that one of the big blockers for people upgrading to ESLint v9.x is that there are still a fair number of plugins that haven't made the changes we outlined in the blog post. This leaves users stuck because they can't migrate to v9.x when their config doesn't work.
What do you think is the correct solution?
I propose creating a new package,
@eslint/backcompat
, that contains functions that wrap existing rules to create acontext
object that looks like the pre-9.x object. This package would export three functions:fixupRule(rule)
- to be applied directly to rule objectsfixupPluginRules(plugin)
- given a plugin, returns an object where all of the rules are wrapped withfixupRule()
fixConfigRules(configs)
- given an array of config objects, wraps all of the plugin definitions usingfixupPluginRules()
.In most cases people would probably use the package like this:
Participation
Additional comments
No response
The text was updated successfully, but these errors were encountered: