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

Eslint setup and fixes #197

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Eslint setup and fixes #197

wants to merge 16 commits into from

Conversation

matejfalat
Copy link
Collaborator

@matejfalat matejfalat commented Oct 26, 2023

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.

@vercel
Copy link

vercel bot commented Oct 26, 2023

@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.

@matejfalat matejfalat requested review from matejos and memoriesadrift and removed request for matejos October 26, 2023 09:27
Copy link
Collaborator

@memoriesadrift memoriesadrift left a 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

@@ -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]'
Copy link
Collaborator

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

Copy link
Collaborator Author

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 🤔

Copy link
Collaborator

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 :/

@matejos
Copy link
Collaborator

matejos commented Oct 26, 2023

Since commit 19614010bf915cc415e013a65798a659de328a5e I'm getting Unhandled Runtime Error at every homepage visit
image

EDIT: Solved by deleting the whole node_modules folder.

@matejfalat matejfalat force-pushed the technical-debt-fixes branch from 94e0f99 to 9629b68 Compare December 1, 2023 16:09
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.

3 participants