Closed
Description
openedon Apr 25, 2024
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 a context
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:
import { fixupConfigRules } from "@eslint/backcompat";
export default fixupConfigRules([
// ... their config
]);
Participation
- I am willing to submit a pull request for this change.
Additional comments
No response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
Type
Projects
Status
Complete