Skip to content
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

prefer-object-rule should port over potential deprecated and schema properties from function-style rule #311

Open
bmish opened this issue Oct 7, 2022 · 0 comments
Labels

Comments

@bmish
Copy link
Member

bmish commented Oct 7, 2022

As seen here, the deprecated/function-style format of ESLint rules can actually export deprecated and schema properties, and we should ensure that eslint-plugin/prefer-object-rule ports those over to the meta object when converting a rule to the modern object-style rule.

Before:

module.exports = function(context) {
    return {
        // callback functions
    };
};

module.exports.schema = [{ /* options */ }];
module.exports.deprecated = true;

After (desired):

module.exports = {
  meta: {
    deprecated: true,
    schema: [{ /* options */ }];
  },
  create() { ... }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant