if the new string starts with the previous string, prefer operator assignment as less code is written
foo = foo + 'baz qux'
foo = `${foo} baz ${qux}`
foo += 'baz qux'
foo += ` baz ${qux}`
ESLint's operator-assignment doesn't catch case with template literal interpolation https://eslint.org/demo#eyJ0ZXh0IjoibGV0IGZvbyA9IGAke2Zvb30gYmF6ICR7cXV4fWBcbmZvbyA9IGZvbyArICdiYXogcXV4JyIsIm9wdGlvbnMiOnsicGFyc2VyT3B0aW9ucyI6eyJlY21hVmVyc2lvbiI6ImxhdGVzdCIsInNvdXJjZVR5cGUiOiJzY3JpcHQiLCJlY21hRmVhdHVyZXMiOnt9fSwicnVsZXMiOnsiY2FwaXRhbGl6ZWQtY29tbWVudHMiOjIsIm9wZXJhdG9yLWFzc2lnbm1lbnQiOjJ9LCJlbnYiOnt9fX0=
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too