💼 This rule is enabled in the ✅ recommended
config.
By default, Ember extends certain native JavaScript objects with additional methods. This can lead to problems in some situations. One example is relying on these methods in an addon that is used inside an app that has the extensions disabled.
The prototype extensions for the String
object were deprecated in RFC #236.
This rule will disallow method calls that match any of the forbidden String
prototype extension method names.
Examples of incorrect code for this rule:
'myString'.dasherize();
someString.capitalize();
'<b>foo</b>'.htmlSafe();
Examples of correct code for this rule:
dasherize('myString');
capitalize(someString);
htmlSafe('<b>foo</b>');
Replace e.g.:
'myString'.dasherize();
with:
import { dasherize } from '@ember/string';
dasherize('myString');