Skip to content

Change Request: Backwards compatibility utility for rules #4

Closed

Description

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:

  1. fixupRule(rule) - to be applied directly to rule objects
  2. fixupPluginRules(plugin) - given a plugin, returns an object where all of the rules are wrapped with fixupRule()
  3. fixConfigRules(configs) - given an array of config objects, wraps all of the plugin definitions using fixupPluginRules().

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

No type

Projects

  • Status

    Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions