Update eslint to latest versions
What does this change?
This PR updates the ESLint tool to the latest versions.
Note that this includes moving to ESLint's new config system - see relevant posts about this made to the ESLint blog .
The primary aim of this update is to get rid of some Dependabot security alerts, and to lower technical debt going forward.
Future Health work
- This PR works because it is turning off (potentially essential) linting checks - eg:
"no-fallthrough": "off" - The current output shows where we are using
eslint-disabledirectives in files. In an ideal world, we should not need those directives. - Future health work should attempt to address these issues by moving each check from
offtowarnand then fixing the code that is causing the warn message. - Once those warnings are fixed, we can move the check (if essential) from
warntoerrorto prevent anyone reintroducing such an error into the code base.
How to test
- Run
yarn lintlocally - there should be plenty of warnings, but no errors reported. - Run the PR in the CODE environment to see if the new system brakes any CI steps.
- Test in CODE - everything should operate as before
There's an issue with the CI build, which I can replicate locally:
- Checkout the branch
- Run
yarnto install dependencies - Run
yarn lint- should pass (24 warnings - all of which areUnused eslint-disable directive) - Run
yarn build- this step fails
The reported CI failure occurs when attempting to build the client module and fails specifically because of a type-check error:
... which I can replicate when building locally:
Interesting aside following on from above comment. If I run yarn lint after running yarn build the lint tests report a whole bunch of fresh errors - all in the newly created dist folders:
This doesn't affect CI because the lint step runs before the build step, but it does make me wonder what the bundler is doing to our source code.