✅ The "extends": "plugin:ember/recommended"
property in a configuration file enables this rule.
Ember by default extends certain native JavaScript objects with additional methods. This can lead to problems in certain situations. One example is relying on these methods in addons, but that addon being used in an app that has the extensions disabled.
Additionally, the prototype extensions for the String
object have been
deprecated in RFC #236.
This rule will look for method calls that match any of the forbidden String
prototype extension methods.
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');