As part of T431803 we not only started modernizing the codebase to use modules (ES6). We also increased the JSHint "esversion" to 9 and had to disable a few rules the same time. We believe this is an opportunity to (mostly automatically) upgrade the codebase to modern syntax.
- Replace ambiguous var with const where possible, otherwise let. These communicate the intention behind a var much better and make the code easier to understand.
- Replace function () with the () => arrow syntax, where appropriate. This notably avoids confusions about the this context and allows us to remove self = this workarounds.