Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to ESLint flat conf and stricter rules #174

Merged
merged 2 commits into from
Mar 9, 2024

Conversation

throwaway96
Copy link
Member

@throwaway96 throwaway96 commented Mar 5, 2024

I ported everything I could from the .eslintrc.json into eslint.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 in tools, webpack.config.js, and eslint.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 linting frontend.

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 or Cannot read property 'x' of undefined.

This PR also updates two runtime dependencies. (Note that dompurify 3.0.2+ causes enyo 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.

@throwaway96 throwaway96 force-pushed the eslint-flat-conf-20240305 branch 2 times, most recently from 3ac179c to 89864e4 Compare March 6, 2024 09:47
services/adapter.ts Show resolved Hide resolved
services/adapter.ts Show resolved Hide resolved
services/webos-service-remote/message.js Outdated Show resolved Hide resolved
services/adapter.ts Show resolved Hide resolved
And make everything pass the new, stricter checks.
Since I'm going to have to test everything anyway...

Note that dompurify 3.0.2+ (up to current version 3.0.9) seems to break
enyo pack --production.
@throwaway96 throwaway96 marked this pull request as ready for review March 9, 2024 04:32
@throwaway96 throwaway96 merged commit 6fdd700 into webosbrew:main Mar 9, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants