Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 2.21 KB

no-string-prototype-replaceall.md

File metadata and controls

62 lines (42 loc) · 2.21 KB
title description since
es-x/no-string-prototype-replaceall
disallow the `String.prototype.replaceAll` method
[eslint-plugin-es] v5.0.0

es-x/no-string-prototype-replaceall

disallow the String.prototype.replaceAll method

This rule reports ES2021 String.prototype.replaceAll method as errors.

This rule is silent by default because it's hard to know types. You need to configure the aggressive mode or TypeScript in order to enable this rule.

💡 Examples

⛔ Examples of incorrect code for this rule:

/*eslint es-x/no-string-prototype-replaceall: [error, { aggressive: true }] */
foo.replaceAll("a", "b")

🔧 Options

This rule has an option.

rules:
  es-x/no-string-prototype-replaceall: [error, { aggressive: false }]

aggressive: boolean

Configure the aggressive mode for only this rule. This is prior to the settings['es-x'].aggressive setting.

🚀 Version

This rule was introduced in eslint-plugin-es v5.0.0.

📚 References