-
Notifications
You must be signed in to change notification settings - Fork 0
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
Eslint setup and fixes #197
base: develop
Are you sure you want to change the base?
Conversation
@matejfalat is attempting to deploy a commit to the wolfsociety-org Team on Vercel. To accomplish this, @matejfalat needs to request access to the Team. Afterwards, an owner of the Team is required to accept their membership request. If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account. |
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.
This will take a while to go over, so just one cursory comment for now from me
src/pages/account.tsx
Outdated
@@ -25,6 +25,7 @@ import { useAccount } from 'wagmi' | |||
import { enqueueSnackbar } from 'notistack' | |||
import { useRouter } from 'next/router' | |||
import { signMessage } from '@/utils/wallet' | |||
import { GetUserResponseData } from './api/user/[address]' |
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.
For some reason, I remember explicitly not wanting to import from api
on the client, but I can't seem to find anything backing up exactly why... leaving this here as a note for now
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 don't really know about such limitation, but maybe import type {...
would be better in this case, so that at least it's not imported during runtime? The idea here was to export the response / request types from api, so that we can assert the same types on client 🤔
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 would be more comfortable with import type
, I'm pretty sure /api/
and the rest need to be separate for security reasons, though I can't find a reference :/
94e0f99
to
9629b68
Compare
Added more strict eslint config and fixing related eslint / TS errors, upgraded some packages and a few minor refactors I did back in August as a preparation for the project. Feel free to discuss or revert the changes 😉
A thorough testing should be probably done before merging/deploying, as I'm not that familiar with the project and might have missed some use cases.
The few remaining eslint errors are related to a mismatch between Contentful CMS models and the types as defined in the app. It would be nice to have the types generated from the Contentful models (it can be done with the https://github.com/contentful-userland/cf-content-types-generator library), however since the generated types don't quite match the currently used types (mostly differ in what properties are optional vs required), either the models would have to be updated in the CMS, or add handling of undefined properties throughout the app. If we're willing to do that, I can also provide the branch with the generated types.