Skip to content

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

Open
@bmish

Description

@bmish

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() { ... }
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions