Skip to main content


added in: 1.6.0

Warns when a String.substring method is used.

String.substring does not support UTF-16 which can result in unexpected output when a string contains emojis.

Use package:characters and characters.getRange instead.

Additional resources:


❌ Bad:

String someValue = '🙂';

someValue.substring(0, 1); // LINT

✅ Good:

String someValue = '🙂';

someValue.characters.getRange(0, 1);