Upgrade Prettier to 2.0
See https://prettier.io/blog/2020/03/21/2.0.0.html.
I tried to make it as easy as possible to review so the MR is split in 4 commits and some of them won't pass the lint checks so the full-history job will fail:
- The first commit uses arrow functions when possible (ie. no async functions) because https://prettier.io/blog/2020/03/21/2.0.0.html#always-add-a-space-after-the-function-keyword-3903httpsgithubcomprettierprettierpull3903-by-j-f1httpsgithubcomj-f1-josephfrazierhttpsgithubcomjosephfrazier-sosukesuzukihttpsgithubcomsosukesuzuki-thorn0httpsgithubcomthorn0-7516httpsgithubcomprettierprettierpull7516-by-bakkothttpsgithubcombakkot will break a lot of things (now a space is always added after the function keyword unless it is a generator). Instead of adding this space the recommended way (see PRs attached) is to use arrow functions. But we can't always do it with our current prettier version so this is an incomplete batch just to separate most of it from the later
yarn pretty
result. - Upgrade prettier & plugins only. The lint will be broken.
- Use arrow functions everywhere no that prettier is up-to-date. Lint is still broken because of other things.
- Finally fix the lint errors.