react/scripts/babel
Sophie Alpert 767f52237c
Use .slice() for all substring-ing (#26677)
- substr is Annex B
- substring silently flips its arguments if they're in the "wrong order", which is confusing
- slice is better than sliced bread (no pun intended) and also it works the same way on Arrays so there's less to remember

---

> I'd be down to just lint and enforce a single form just for the potential compression savings by using a repeated string.

_Originally posted by @sebmarkbage in https://github.com/facebook/react/pull/26663#discussion_r1170455401_
2023-04-19 14:26:01 -07:00
..
__tests__ [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
getComments.js Transform updates to support Flow this annotation syntax (#25918) 2023-01-05 15:41:49 -05:00
transform-object-assign.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
transform-prevent-infinite-loops.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
transform-react-version-pragma.js Transform updates to support Flow this annotation syntax (#25918) 2023-01-05 15:41:49 -05:00
transform-replace-console-calls.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
transform-test-gate-pragma.js Use .slice() for all substring-ing (#26677) 2023-04-19 14:26:01 -07:00