-
Notifications
You must be signed in to change notification settings - Fork 7
Fix ESLint configuration, fix errors, add as GitHub action #232
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
base: main
Are you sure you want to change the base?
Conversation
williamschen23
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall I'd reconsider some of the missing dependency arrays. Some of them do make sense excluding, which is why personally id rather disable the eslint rule (or warning) over trying to fix them
| }; | ||
| mapkitScript(); | ||
| }, []); | ||
| }, [token]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since token never changes, we shouldnt useMemo it. In react 19.2, there is an useEventEffect function that seems to be perfect for this. In addition, we don't need to fix all the dependency array issues since they are warnings and not errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will change. I pass --max-warnings=0, so it doesn't tolerate warnings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eslint github actions doesnt fail on warnings i thought?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by default it doesn't, but if you pass --max-warnings it will.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to enforce 0 warnings? I feel like sometimes the warnings are fine as react dependency arrays don't really need some of the dependencies eslint is hinting at
This reverts commit 3b978d6.
Describe what you are trying to do
Fix the misconfigured ESLint and fix all current errors in ESLint, and make it a GitHub Action that runs on push and pull, so that all frontend code will be linted.
Steps for review
useEffect, ...).npm run lint.