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

chore: lint all the things #131

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

chore: lint all the things #131

wants to merge 3 commits into from

Conversation

wejendorp
Copy link
Contributor

@wejendorp wejendorp commented Sep 14, 2023

Fix linter issues in almost all places.

This should make the linter pass, so we can start caring about it again.

@wejendorp wejendorp changed the title chore: lint all the things (wip) chore: lint all the things Sep 14, 2023
Copy link
Contributor

@andertun andertun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice that you improved the code of this repo to follow our lining rules a bit more 💪

I am a bit worried about the changes related to the react hooks. Adding things to the dependency arrays will potentially change how the code behaves. Thorough testing is required on this PR!

Also I don't think we should disable the rules-of-hooks as they are quite important to follow (unless we are absolutely sure we want to ignore them a few places). I think it can be hard to reason about code that doesn't follow those rules, and to maintain it.

Lastly, can we change to use @kapeta/eslint-config? I think some rules in this repo are stricter than what we need.

@@ -21,7 +21,7 @@ export const kapetaDark = createTheme(
{
components: {
MuiLink: {
//@ts-ignore
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can make a habit of explaining in the comment why we tell TS to ignore an error whenever we use @ts-ignore so we know the reason for it.

Comment on lines 97 to 98
// TODO: This seems bad
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed 😬

@@ -13,12 +12,13 @@ interface Props {

export const SamplePlanSection = (props: Props) => {
const title = props.sample.content.metadata.title ?? props.sample.content.metadata.name;
const hack = useLoadedPlanContext(props.sample.content);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it a hack?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really any more, I started out throwing it around a bit and it seems like it ended up working :)

Comment on lines 1 to 2
// TODO: seems bad
/* eslint-disable react-hooks/rules-of-hooks */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, why disable it? IMO the hook rules are quite important to avoid hard-to-debug bugs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change them to warnings, then we still get the squiggles, but it won't block the build.

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.

None yet

2 participants