Skip to content

Conversation

@gribnoysup
Copy link
Collaborator

@gribnoysup gribnoysup commented Jun 12, 2025

I'm slowly continuing to update eslint to latest, this patch updates typescript-eslint to the latest version, this actually brings a lot of changes to the recommended rules, to avoid making this totally unreviewable I'm currently switching all the new or updated rules to warn and will go through them one by one in the follow-ups.

Most of those are actually not encountered that often or autofixable / easy to fix, so it should be a pretty straightforward follow-up process.

The only one that's real nasty is the no explicit any one. Even though it was on by default before and we even have explicit disabling where appropriate, something changed in how the rule is detected or applied and so there's a ton of legit cases where it gets triggered in the code (and it's hard for me to tell why this wasn't happening before)

@gribnoysup gribnoysup requested a review from a team as a code owner June 12, 2025 13:09
Comment on lines +18 to +19
'@typescript-eslint/prefer-promise-reject-errors': 'off',
'@typescript-eslint/only-throw-error': 'off',
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These new recommended ones I'm actually not sure if they are helpful to be honest, so I'm planning to keep those disabled, tell me if you have any concerns with that

Copy link
Member

@Anemy Anemy Jun 12, 2025

Choose a reason for hiding this comment

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

Both of these appear to me to be helpful for ensuring our error formatting is consistent.
https://typescript-eslint.io/rules/only-throw-error/
https://typescript-eslint.io/rules/prefer-promise-reject-errors/
I think I'd be in favor of having them on if its not a big lift. Also something we could do later. Are there situations where they would be not helpful I might not be thinking of? (Not a blocker, changes look good!)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Talked with Le Roux also and I'll take another pass on those, but I also don't think the rule really works as well as the description shows. To give you an example, every re-thrown error triggers this rule and we have to manually assert Error on it (because we never know the type), this just seems unhelpful and we re-throw quite often due to logging. But just to re-iterate, I'll take a closer look there when following up just to make sure I'm not disabling something actually useful, thanks for sharing your thoughts on that!

@gribnoysup gribnoysup added the no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion) label Jun 12, 2025
definitions are pretty strict. We require these disabled to avoid
tests flaking out hence ignoring the usage here.
@ts-ignore */}
@ts-expect-error ^^^ */}
Copy link
Contributor

Choose a reason for hiding this comment

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

love the ^^^ 😆

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That was the easiest way to deal with no-ts-ignore... 😅

@gribnoysup gribnoysup merged commit 4e5b7fa into main Jun 13, 2025
59 checks passed
@gribnoysup gribnoysup deleted the update-typescript-eslint-to-latest branch June 13, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-title-validation Skips validation of PR titles (conventional commit adherence + JIRA ticket inclusion)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants