Switch to ESLint flat conf and stricter rules #174
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I ported everything I could from the
.eslintrc.json
intoeslint.config.mjs
. I think I got everything meaningful. The result is pretty ugly, although that seems to be par for the course with flat configs.It checks JS and TS files in
services
, JS files intools
,webpack.config.js
, andeslint.config.mjs
itself. It also now checks JSON files, at least for syntax errors. This new config format should make it relatively easy (😬) to add support for lintingfrontend
.There were a bunch of changes required to pass the new checks. The related changes for
elevate-service.ts
are in #173.Some of the changes are not strictly necessary for passing the new checks. I am thinking about breaking these out into a separate commit/PR. My goal is to code defensively and provide users with enough feedback to determine the cause of an error. I'm hoping that when LG inevitably changes something in the future, users will get more useful error messages than
undefined is not a function
orCannot read property 'x' of undefined
.This PR also updates two runtime dependencies. (Note that
dompurify
3.0.2+ causesenyo pack --production
to fail.)I haven't tested this yet, but it's pretty big so I'll put it here now in case anyone wants to take a look at it.