In the next diff, we update ESLint, which necessitates replacing the deprecated babel-eslint with the new @babel/eslint-parser.
The new @babel/eslint-parser appears to break yarn eslint:fix from the repo root, since it can't find a Babel config file.
To address this, I had to update our Babel config to work from the root. Some relevant docs I had to read:
- https://babeljs.io/docs/config-files#project-wide-configuration
- https://babeljs.io/docs/config-files#file-relative-configuration
- https://babeljs.io/docs/config-files#monorepos
- https://babeljs.io/docs/options#babelrcroots
In short, Babel's docs recommend that for a monorepo setup, you use a single babel.config.cjs file in the root, and then specify .babelrc.cjs files for individual workspaces. However, this didn't work with Jest, which was ignoring the .babelrc.cjs files. This is documented in issues on the Jest repo, but there are no official solutions. To get around this, I ended up also specifying babel.config.cjs files for the individual workspaces, that simply reference the .babelrc.cjs files.
Depends on D10536