📝 Disallow using the meta.replacedBy rule property.
💼 This rule is enabled in the ✅ recommended config.
As of ESLint v9.21.0, the rule property meta.deprecated can be either a boolean or an object of type DeprecatedInfo. The DeprecatedInfo type includes an optional replacedBy array that replaces the now-deprecated meta.replacedBy property.
Examples of correct usage:
This rule disallows the meta.replacedBy property in a rule.
Examples of incorrect code for this rule:
/* eslint eslint-plugin/no-meta-replaced-by: error */
module.exports = {
meta: {
deprecated: true,
replacedBy: ['the-new-rule'],
},
create() {},
};Examples of correct code for this rule:
/* eslint eslint-plugin/no-meta-replaced-by: error */
module.exports = {
meta: {
deprecated: {
message: 'The new rule adds more functionality',
replacedBy: [
{
rule: {
name: 'the-new-rule',
},
},
],
},
},
create() {},
};
module.exports = {
meta: {
deprecated: true,
},
create() {},
};