Skip to content

Conversation

david-crespo
Copy link
Collaborator

@david-crespo david-crespo commented May 24, 2024

I got nerd sniped by this tweet and first turned on the full recommended config (which I've tried before) and it was awful:

image

Then I read this great blog post, which is linked in the tweet

https://www.joshuakgoldberg.com/blog/rust-based-javascript-linters-fast-but-no-typed-linting-right-now/#recap-type-checked-linting

and it points to a couple of specific rules that it likes. So I tried turning those on and it is actually a little bit useful and doesn't slow things down that much (I also narrowed down the scope of what we're linting a bit).

image

Copy link

vercel bot commented May 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
console ✅ Ready (Inspect) Visit Preview May 24, 2024 4:50pm

variant: 'error',
title: `Error stopping instance '${instance.name}'`,
content: error.message,
}),
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is interesting! What happened here is that the new eslint rule made me remove the async because there was no await, which allowed TS to see that the function was not returning a promise like it was supposed to (I guess every async function returns Promise<_> automatically), so that errored, alerting me to the fact that this is set up wrong. It was working fine because of the manual toast, but the errorTitle bit below now covers that because the error handled inside confirmAction.

This is kind of a confusing pattern, but I think the idea was to ensure that there is always some error toast. On unconfirmed actions like instance start, there's nothing forcing you to handle the error, so if you forget to define onError, it does nothing on error, which is annoying. The problem now is that on ones wrapped in confirmAction, you don't see an onError, so maybe you think that's the normal way, but for non-confirmed actions you need to define it.

@david-crespo david-crespo changed the title Turn on a couple of type-aware lint rules Turn on type-aware lint rules May 24, 2024
@david-crespo david-crespo merged commit bf97ebc into main May 24, 2024
@david-crespo david-crespo deleted the type-aware-linting branch May 24, 2024 17:18
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.

1 participant